- Install and setup
serverless
. - Install deps (run
yarn
). - Create
.env
file. (required configs:PRODUCTION_URL_APP
,MONGO_URL_TEST
,MONGO_URL
,Amazon_accessKeyId
,Amazon_secretAccessKey
,EMAIL_SUPPORT_FROM_ADDRESS
) - Also you can create
.env.production
file for production deploy.
- Development deploy: Run
sls deploy
- Production deploy: Run
NODE_ENV=production sls deploy
- If files did not change: Add
--force
- Deploy particular function:
NODE_ENV=production sls deploy function --function sendEmailForNewPost
- For invoking
sendEmailForNewPost
locally runsls invoke local -l -f sendEmailForNewPost
. - For invoking
sendEmailForNewPost
runsls invoke -l -f sendEmailForNewPost
.