diff --git a/app.js b/app.js index 2fc8319..c091745 100644 --- a/app.js +++ b/app.js @@ -18,23 +18,23 @@ app.use(session({ })); /*** Database ***/ -const { connectMongo, getCollection } = require("./src/database/connection"); +// const { connectMongo, getCollection } = require("./src/database/connection"); -let users; -async function initDatabase() { - const mongoURI = process.env.mongoURI || "mongodb://localhost:27017/"; - const database = process.env.database || "knoldus"; // Database name +// let users; +// async function initDatabase() { +// const mongoURI = process.env.mongoURI || "mongodb://localhost:27017/"; +// const database = process.env.database || "knoldus"; // Database name - const db = await connectMongo(mongoURI, database); +// const db = await connectMongo(mongoURI, database); - // For any collection, init here - users = await getCollection(db, "users"); -} +// // For any collection, init here +// users = await getCollection(db, "users"); +// } -initDatabase().then(() => { - require("./src/auth/authentication")(app, users); -}); +// initDatabase().then(() => { +// require("./src/auth/authentication")(app, users); +// }); /* ROUTINGS @@ -42,7 +42,7 @@ ROUTINGS app.get('/', (req, res) => { if (!req.session.errMessage) req.session.errMessage = ""; - res.render('index'); + res.render('layout'); }); app.get('/landing', (req, res) => { diff --git a/src/views/index.ejs b/src/views/index.ejs index 04287c1..20ea401 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -1,14 +1 @@ - - - -
- - -The index page
\ No newline at end of file diff --git a/src/views/layout.ejs b/src/views/layout.ejs new file mode 100644 index 0000000..92b7356 --- /dev/null +++ b/src/views/layout.ejs @@ -0,0 +1,13 @@ + + + + + + + +