2.0.0 • Published 6 years ago

bragg-env v2.0.0

Weekly downloads
630
License
MIT
Repository
github
Last release
6 years ago

bragg-env Build Status

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

License

MIT © Sam Verschueren

2.0.0

6 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago