From 8dc2f1e48503c27cbd2aac3c455adac7781a6539 Mon Sep 17 00:00:00 2001 From: hiromitz Date: Sun, 13 Jul 2014 19:26:00 +0900 Subject: [PATCH] fix(templates:express:config) express deprecated issue --- app/templates/server/config/express.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/templates/server/config/express.js b/app/templates/server/config/express.js index 1ef0eccb7..e69d82f22 100644 --- a/app/templates/server/config/express.js +++ b/app/templates/server/config/express.js @@ -26,7 +26,8 @@ module.exports = function(app) { app.set('view engine', 'html');<% } %><% if (filters.jade) { %> app.set('view engine', 'jade');<% } %> app.use(compression()); - app.use(bodyParser()); + app.use(bodyParser.urlencoded({ extended: false })); + app.use(bodyParser.json()); app.use(methodOverride()); app.use(cookieParser()); <% if (filters.auth) { %>app.use(passport.initialize());<% } %><% if (filters.twitterAuth) { %> @@ -35,6 +36,8 @@ module.exports = function(app) { // We need to enable sessions for passport twitter because its an oauth 1.0 strategy app.use(session({ secret: config.secrets.session, + resave: true, + saveUninitialized: true, store: new mongoStore({ url: config.mongo.uri, collection: 'sessions'