O'Reilly logo
  • Patrick S thinks this is interesting:

env setting are as follows:

  • development
  • test
  • stage
  • preview
  • production

The “production” and “development” values are used by Express.js for certain settings’ defaults (view cache is one of them). The other values are just convention, meaning you’re free to use whatever you want as long as you are consistent. For exa...


Cover of Pro Express.js


env setting if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); }