Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanburnette/serverless-config-environment-variables
https://github.com/ryanburnette/serverless-config-environment-variables
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ryanburnette/serverless-config-environment-variables
- Owner: ryanburnette
- Created: 2018-10-12T16:58:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-12T17:02:17.000Z (over 6 years ago)
- Last Synced: 2024-11-19T19:52:25.693Z (3 months ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# serverless-config-environment-variables
Testing out configuring the environment on Serverless.
These two lines in `serverless.yml` do the job.
```yml
...
stage: ${opt:stage, 'dev'}
environment: ${file(./serverless.config.${self:provider.stage}.yml)}
```This reads in `serverless.config.dev.yml`, replace `dev` with the desired
stage, and sets those environment variables accordingly.Deploy this and see `process.env` in the response to the HTTP event.
The config files normally wouldn't be committed to Git.