Install DynamoDB Local sls dynamodb install , This package has issue in installing please read this github page
run sls dynamodb start --migrate
run sls offline start
Tests
run sls offline start
run npm run test on another terminal.
Deployment
Install dependencies with:
npm install
and then deploy with:
serverless deploy
After running deploy, you should see output similar to:
Deploying aws-node-express-dynamodb-api-project to stage dev (us-east-1)
✔ Service deployed to stack aws-node-express-dynamodb-api-project-dev (196s)
endpoint: ANY - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
functions:
api: aws-node-express-dynamodb-api-project-dev-api (766 kB)
Note: In current form, after deployment, your API is public and can be invoked by anyone. For production deployments, you might want to configure an authorizer. For details on how to do that, refer to httpApi event docs. Additionally, in current configuration, the DynamoDB table will be removed when running serverless remove. To retain the DynamoDB table even after removal of the stack, add DeletionPolicy: Retain to its resource definition.