Created
September 6, 2019 16:46
-
-
Save DavidWells/8fe17c3911896ef2ac1928cc949756af to your computer and use it in GitHub Desktop.
Serverless config with function support. https://github.com/DavidWells/configorama#usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| service: my-service | |
| custom: | |
| one: 'hello' | |
| two: 'there' | |
| together: ${merge(${custom.one}, ${custom.two})} | |
| # ^ resolves to 'hellothere' | |
| provider: | |
| name: aws | |
| runtime: nodejs8.10 | |
| functions: | |
| currentTime: | |
| handler: handler.endpoint | |
| events: | |
| - http: | |
| path: ping | |
| method: get |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Serverless framework reads this file */ | |
| const path = require('path') | |
| const configorama = require('configorama') | |
| const cliFlags = require('minimist')(process.argv.slice(2)) | |
| // Path to yaml/json/toml config | |
| const myConfigFilePath = path.join(__dirname, 'serverless-config.yml') | |
| // Configorama can take file paths or JS objects. | |
| const serverlessConfig = configorama.sync(myConfigFilePath, { | |
| options: cliFlags | |
| }) | |
| module.exports = serverlessConfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment