From ad95ea36ef7a3c2ee6b6f0d5009f3353098479a9 Mon Sep 17 00:00:00 2001 From: Peter Blazejewicz Date: Sun, 17 Nov 2013 18:53:17 +0100 Subject: [PATCH] Update middleware for body parsing in Express MEAN configuration - update Express middleware configuration - remove reference and documentation to bodyParser middleware - add middleware for json/urlencoded requests - Fixes #136 on MEAN linnovate/mean --- config/express.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/express.js b/config/express.js index 9a81a7e2b9..a411fd47f9 100755 --- a/config/express.js +++ b/config/express.js @@ -41,8 +41,9 @@ module.exports = function(app, passport, db) { //cookieParser should be above session app.use(express.cookieParser()); - //bodyParser should be above methodOverride - app.use(express.bodyParser()); + // request body parsing middleware should be above methodOverride + app.use(express.urlencoded()); + app.use(express.json()); app.use(express.methodOverride()); //express/mongo session storage