aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/index.js b/index.js
index 2d2fdef..b772ad2 100644
--- a/index.js
+++ b/index.js
@@ -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,