|
|
|
@ -4,6 +4,7 @@ var favicon = require('serve-favicon');
@@ -4,6 +4,7 @@ var favicon = require('serve-favicon');
|
|
|
|
|
var logger = require('morgan'); |
|
|
|
|
var cookieParser = require('cookie-parser'); |
|
|
|
|
var bodyParser = require('body-parser'); |
|
|
|
|
var env = require('./config/config.json')['env']; |
|
|
|
|
|
|
|
|
|
var index = require('./routes/index'); |
|
|
|
|
var address = require('./routes/address'); |
|
|
|
@ -42,7 +43,7 @@ app.use(function(req, res, next) {
@@ -42,7 +43,7 @@ app.use(function(req, res, next) {
|
|
|
|
|
app.use(function(err, req, res, next) { |
|
|
|
|
// set locals, only providing error in development
|
|
|
|
|
res.locals.message = err.message; |
|
|
|
|
res.locals.error = req.app.get('env') === 'development' ? err : {}; |
|
|
|
|
res.locals.error = env === 'development' ? err : {}; |
|
|
|
|
|
|
|
|
|
// render the error page
|
|
|
|
|
res.status(err.status || 500); |
|
|
|
|