...
|
...
|
@@ -9,7 +9,7 @@ var express = require('express'), |
|
|
exphbs = require('express-handlebars'),
|
|
|
bodyParser = require('body-parser');
|
|
|
|
|
|
var logger = require('morgan'),
|
|
|
var morgan = require('morgan'),
|
|
|
favicon = require('serve-favicon'),
|
|
|
cookieParser = require('cookie-parser'),
|
|
|
session = require('express-session'),
|
...
|
...
|
@@ -38,7 +38,7 @@ app.engine('.hbs', exphbs({ |
|
|
app.set('view engine', '.hbs');
|
|
|
|
|
|
app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
|
|
|
app.use(logger('dev'));
|
|
|
app.use(morgan('dev'));
|
|
|
app.use(bodyParser.json());
|
|
|
app.use(bodyParser.urlencoded({extended: false}));
|
|
|
app.use(cookieParser());
|
...
|
...
|
@@ -76,7 +76,7 @@ app.use(function(req, res) { |
|
|
// 捕获全局错误, 开发环境返回错误详情
|
|
|
app.use(function(err, req, res) {
|
|
|
if (app.locals.devEnv) {
|
|
|
console.log(err);
|
|
|
console.warn(err);
|
|
|
} else {
|
|
|
err = {};
|
|
|
}
|
...
|
...
|
|