Install serverless and apidoc globally:
npm -i g serverless
npm -i g apidoc
Install other packages :
yarn
OR npm install
Execute unit test
yarn test
OR npm test
Local development
yarn start
OR npm start
Generating API Documents based on comments
apidoc -i src/ -o public/docs
After setting AWS credentials in environment, Change Parameter as you feel right.
Verify App configuration for stage you are deploying, update file: ./src/config/[YOUR_STAGE]Config.js
serverless deploy --stage YOUR_STAGE --region YOUR_REGION --cognitoPoolArn YOUR_USERPOOL_ARN
For example, if your stage is "dev", then
- update
./src/config/devConfig.js
with correct configuration for that environment. - deploy:
serverless deploy --stage dev --region us-west-2 --cognitoPoolArn arn:aws:cognito-idp:us-west-2:[your_account_id]:userpool/[your_userpool_id]
For example, if your stage is "prod", then
- update
./src/config/prodConfig.js
with correct configuration for that environment. - deploy:
serverless deploy --stage prod --region us-west-2 --cognitoPoolArn arn:aws:cognito-idp:us-west-2:xxxxxxx:userpool/somethingBlah