All Projects → y13i → serverless-ts-boilerplate

y13i / serverless-ts-boilerplate

Licence: other
Example project built with TypeScript, Serverless Framework, Webpack, TSLint, Source Map Support and Dalamb.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

serverless-ts-boilerplate

Example project built with TypeScript, Serverless Framework, Webpack, TSLint, Source Map Support and Dalamb.

Usage

Clone the repo.

$ git clone [email protected]:y13i/serverless-ts-boilerplate.git

Install dependencies.

$ cd serverless-ts-boilerplate
$ yarn

Replace service name in serverless.yml

$ sed -i -e 's/serverless-ts-boilerplate/my-service/g' serverless.yml

Deploy example.

$ yarn run serverless deploy

Try HTTP request.

$ curl -s "https://${API_ID}.execute-api.${AWS_REGION}.amazonaws.com/dev/diceRoll" | jq

With some parameters.

$ curl -s "https://${API_ID}.execute-api.${AWS_REGION}.amazonaws.com/dev/diceRoll?faces=4&quantity=4" | jq

Raise some error.

$ curl -s "https://${API_ID}.execute-api.${AWS_REGION}.amazonaws.com/dev/diceRoll?faces=7" | jq

Confirm sourcemap works.

$ yarn run serverless invoke --function diceRoll --data '{"queryStringParameters": {"faces": "7"}}'

You can also review errors in CloudWatch Logs by using serverless logs command.

$ yarn run serverless logs --function diceRoll

Remove resources.

$ yarn run serverless remove

Happy coding!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].