I am new to nodeJs+ExpressJs app setup. I would like to run app.js in a custom environment.
For an example:
NODE_ENV=production node app.js will run the app in production mode and the view templates will be cached. But there is an option, that we can run the app.js in any custom mode like NODE_ENV=custom_environment node app.js. If it is the case, how to catch the view templates ? or will it catch for all the environment mode ? In-terms of development mode, I don't think view templates are cached.
You can choose which settings are used for which environment using app.configure:
app.configure('custom_environment', function() {
app.enable('view cache'); // enable view cache for this environment
// perhaps load middleware specific for your custom environment:
app.use(...);
});