bragg-env
v2.0.0
Published
Environment middleware for bragg
Downloads
3,561
Maintainers
Readme
bragg-env
Environment middleware for bragg.
Install
$ npm install --save bragg-env
Usage
const app = require('bragg')();
const environment = require('bragg-env');
app.use(environment());
app.use(ctx => {
console.log(ctx.env);
//=> 'staging'
});
You can use the NODE_ENV
environment variable to overwrite the context environment.
process.env.NODE_ENV = 'test';
app.use(environment());
app.use(ctx => {
console.log(ctx.env);
//=> 'test'
});
API
environment([options])
Exposes the environment in the env
property of the context
object.
options
Type: object
Default: {$LATEST: 'development', default: 'production'}
An aws-lamba-env options object.
Related
- aws-lamba-env - API for this module
License
MIT © Sam Verschueren