This template demonstrates how to deploy a TypeScript function running on AWS Lambda using Serverless Framework. The deployed function does not include any event definitions as well as any kind of persistence (database). For more advanced configurations check out the examples repo which includes integrations with SQS, DynamoDB or examples of functions that are triggered in cron
-like manner. For details about configuration of specific events
, please refer to our documentation.
In order to deploy the example, you need to run the following command:
$ serverless deploy
After running deploy, you should see output similar to:
Deploying demo-bot to stage dev (us-east-1)
✔ Service deployed to stack demo-bot-dev (112s)
functions:
hello: demo-bot-dev-hello (806 B)
After successful deployment, you can invoke the deployed function by using the following command:
serverless invoke --function hello
Which should result in response similar to the following:
{
"message": "Go Serverless v3! Your function executed successfully!",
"input": {}
}
You can invoke your function locally by using the following command:
serverless invoke local --function hello
Which should result in response similar to the following:
{
"message": "Go Serverless v3! Your function executed successfully!",
"input": {}
}