Adds environment-specific hooks to express apps
npm install --save expressive
var expressive = ;var express = ;var app = ;;app;appdevelopment;
When you call
expressive and pass in an express app, it will add environment specific hooks that you can use for specific environments only. By default, it will use
['development'] as the environment list, but you can pass an array of environments as a second argument (or a single string if you only setting up one environment), or an options object (outlined below).
This is similar to wrapping
app calls in checks against the environment, but I've found that this method makes an app easier to read because all the route definitions are parallel.
You can specify the following options to change the default behavior:
The aforementioned list of environments
// "envs" can also be a string here;
The current environment. Defaults to
Additionally, you can pass this env as a third parameter, which can help keep the syntax short.
app.development.use seems long, you can provide environment aliases to shorten it.
Then you can just use