Reducing the double env === development

This commit is contained in:
Andrew Davidson 2016-01-23 17:30:24 -05:00
parent 44ad65a5b0
commit fa0fd2b07f

4
app.js
View file

@ -50,9 +50,6 @@ app.use(session({
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
if (app.get('env') === 'development') {
app.locals.pretty = true;
}
// Setup authentication via twitter. // Setup authentication via twitter.
passport.use(new Strategy( passport.use(new Strategy(
@ -148,6 +145,7 @@ app.use(function(req, res, next) {
// development error handler // development error handler
// will print stacktrace // will print stacktrace
if (app.get('env') === 'development') { if (app.get('env') === 'development') {
app.locals.pretty = true;
app.use(function(err, req, res, next) { app.use(function(err, req, res, next) {
res.status(err.status || 500); res.status(err.status || 500);
res.render('admin-error', { res.render('admin-error', {