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