diff --git a/app.js b/app.js index f09e09d96..7eaecc224 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,7 @@ var express = require('express'), bodyParser = require('body-parser'), methodOverride = require('method-override'), - errorHandler = require('error-handler'), + errorHandler = require('express-error-handler'), morgan = require('morgan'), routes = require('./routes'), api = require('./routes/api'), @@ -25,7 +25,8 @@ app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(morgan('dev')); -app.use(bodyParser()); +app.use(bodyParser.urlencoded({extended: true})); +app.use(bodyParser.json()); app.use(methodOverride()); app.use(express.static(path.join(__dirname, 'public'))); @@ -33,7 +34,7 @@ var env = process.env.NODE_ENV || 'development'; // development only if (env === 'development') { - app.use(express.errorHandler()); + app.use(errorHandler()); } // production only diff --git a/package.json b/package.json index 4b627f3e8..67c89ab9a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "body-parser": "^1.0.2", - "error-handler": "^0.1.4", + "express-error-handler": "^1.0.1", "express": "~4.1.1", "jade": "~0.31.2", "method-override": "^1.0.0",