mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Read this on the main serverless docs site
Hello World C# Example
Make sure serverless is installed. See installation guide.
1. Create a service
serverless create --template aws-csharp --path myService or sls create --template aws-csharp --path myService, where 'myService' is a new folder to be created with template service files. Change directories into this new folder.
2. Build using .NET CLI tools and create zip package
# Linux or OSX
./build.sh
# Windows PowerShell
./build.cmd
3. Deploy
serverless deploy or sls deploy. sls is shorthand for the Serverless CLI command
4. Invoke deployed function
serverless invoke --function hello or serverless invoke -f hello
-f is shorthand for --function
In your terminal window you should see the response from AWS Lambda
{
"Message": "Go Serverless v1.0! Your function executed successfully!",
"Request": {
"Key1": null,
"Key2": null,
"Key3": null
}
}
Congrats you have just deployed and run your Hello World function!