Load a config file based upon the environment
$ npm install bragg-load-config
config.json
{
"production": {
"FooService": "foo:v0"
}
}
const app = require('bragg')();
const environment = require('bragg-env');
const loadConfig = require('bragg-load-config');
app.use(environment());
app.use(loadConfig('config.json'));
app.use(ctx => {
console.log(ctx.config);
/**
* {
* "FooService": "foo:v0"
* }
*/
});
It's possible to override config data based upon the AWS Account ID.
{
"_overrides": {
"account:123456789012": {
"FooService": "foo:v1"
}
},
"production": {
"FooService": "foo:v0"
}
}
If the AWS Account ID matches 123456789012
, it will merge that config object with the specific environment config object.
Type: string
Path to the config file.
Type: string
Default: process.cwd()
Working directory of the config file.
MIT © Sam Verschueren