diff options
-rw-r--r-- | index.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -5,10 +5,9 @@ const session = require('express-session'); const MongoSessionStore = require('connect-mongo'); const flash = require('connect-flash'); const passport = require('passport'); -const {port, mongoUrl, masterKey} = require("./config/env") +const {port, mongoUrl, masterKey} = require("./config/env") const oldForm = require('./utils/middleware/oldForm'); - const webRoutes = require('./routes/web'); const app = express(); @@ -19,6 +18,9 @@ mongoose.connect(mongoUrl, { useFindAndModify: false }); +mongoose.connection.on('error', console.error.bind(console, 'connection error:')); +mongoose.connection.once('open', () => console.log("Successfully connected to MongoDB!")); + app.use(session({ secret: masterKey, resave: false, |