This template is a starter point on running on AWS Lambda and API Gateway using the Serverless Framework.
$ serverless deploy
After deploying, you should see output similar to:
Deploying aws-node-http-api-project to stage dev (us-east-1)
โ Service deployed to stack aws-node-http-api-project-dev (152s)
endpoint: GET - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/
functions:
hello: aws-node-http-api-project-dev-hello (1.9 kB)
After successful deployment, you can call the created application via HTTP:
curl https://xxxxxxx.execute-api.us-east-1.amazonaws.com/
Which should result in response similar to the following (removed input
content for brevity):
{
"message": "Go Serverless v2.0! Your function executed successfully!",
"input": {
...
}
}
You can invoke your function locally by using the following command:
$ npm run start:local
$ npm run infra:local