From dda1a8d9b7314cf255f413d73194ac1ab8e0dd2c Mon Sep 17 00:00:00 2001 From: Biswashree Dey Date: Tue, 19 Oct 2021 18:27:05 +0530 Subject: [PATCH] Update app.js --- app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 744c3f1..1663509 100644 --- a/app.js +++ b/app.js @@ -7,7 +7,7 @@ const exphbs = require('express-handlebars') const methodOverride = require('method-override') const passport = require('passport') const session = require('express-session') -const MongoStore = require('connect-mongo')(session) +const MongoStore = require('connect-mongo') const connectDB = require('./config/db') // Load config @@ -73,7 +73,8 @@ app.use( secret: 'keyboard cat', resave: false, saveUninitialized: false, - store: new MongoStore({ mongooseConnection: mongoose.connection }), + store: MongoStore.create({ + mongoUrl: process.env.MONGO_URI }), }) )