Stream function logs into your terminal
sls logs --function [FUNCTION_NAME] --stage prod --tail
python template/initiate_new_project.py
npm init
npm install serverless@2.64 --save
Install Python dependencies
cd REPOSITORY_NAME
pipenv install
Stream function logs into your terminal
prod-sls logs --function main --stage prod --tail
black . --line-length 120
Create requirements.txt file:
pipenv lock -r > requirements.txt
Invoke a function locally using dev and prod
sls invoke local -f [FUNCTION_NAME] --path ./data/event.json
sls invoke local -f [FUNCTION_NAME] --path ./data/event.json
prod-sls deploy --stage prod --verbose
Install serverless plugin
sls plugin install --name serverless-python-requirements