- Install via npm:
npm install -g serverless-
Set-up your Provider Credentials. Watch the video on setting up credentials
-
Clone the Project
git clone https://github.com/scriptstar/todo-serverless
cd todo-serverless
npm install-
Setting up CircleCI https://serverless.com/blog/ci-cd-workflow-serverless-apps-with-circleci/
-
a) Make changes and push the repository
Circle CI will build the project and deploy automatically
or
- b) Deploy the Service manually:
Use this when you have made changes to your Functions, Events or Resources in serverless.yml or you simply want to deploy all changes within your Service at the same time.
serverless deploy -vgetTodos
createTodo
updateTodo
destroyTodo
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.ReadData.html
see the last answer: https://stackoverflow.com/questions/50598623/aws-dynamodb-not-fetching-data-synchronously-by-node-js
sls deploy
sls deploy --f [name-of-the-function]
sls logs --function [name-of-the-function]
e.g: sls logs --function getTodos
curl https://bryvyl33nd.execute-api.us-east-1.amazonaws.com/dev/todos
curl -X POST https://bryvyl33nd.execute-api.us-east-1.amazonaws.com/dev/todos --data '{ "todo": "make to-do app" }'
curl -X PUT https://bryvyl33nd.execute-api.us-east-1.amazonaws.com/dev/todos --data '{"id":"efeca490-5cbe-4efe-a1c0-d4e88aefa773","isComplete":true,"todo":"show to Haneela"}'
curl -X DELETE https://bryvyl33nd.execute-api.us-east-1.amazonaws.com/dev/todos/386beb7f-cf44-48f7-a1f6-2ee59b94da51
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/api-permissions-reference.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.NodeJs.03.html
Get Returnvalues https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html