To run a function on your local
$ serverless invoke local --function helloTo simulate API Gateway locally using serverless-offline
$ serverless offline startDeploy your project
$ serverless deployDeploy a single function
$ serverless deploy function --function helloTo add environment variables to your project
- Rename
env.exampleto.env. - Add environment variables for your local stage to
.env. - Uncomment
environment:block in theserverless.ymland reference the environment variable as${env:MY_ENV_VAR}. WhereMY_ENV_VARis added to your.envfile. - Make sure to not commit your
.env.