- Node.js version 6.10.2 (AWS Lambda version)
- Babel for ES7 async/await support (and more)
- Koa version 2
- Serverless framework
- AWS X-Ray
- AWS API Gateway
$ nvm install
(will use the .nvmrc Node.js version 6.10.2)$ npm install
(install dependencies)$ npm install -g serverless
(global installation of serverless)
$ npm run dev
(run serverless-offline for local development)$ npm run deploy-dev
(deploys the service to dev)$ npm run deploy-prod
(deploys the service to prod)
(using the AWS credentials in ~/.aws/credentials)
There are 2 example endpoints under the handler.js
file (run the local dev server $ npm run dev
)
$ curl -X GET http://localhost:3000/
$ curl -X POST \
http://localhost:3000/echo \
-H 'Content-Type: application/json' \
-d '{"name": "testing echo service"}'
The template is based on Serverless Node.js Starter