-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
55 lines (43 loc) · 1.51 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const express= require('express');
const app = express();
const port = process.env.PORT || 3000;
const nodeMailer= require("nodemailer");
require('dotenv').config();
// const baseRoutes= require('./routes/baseRoutes');
const authRoutes= require('./routes/authRoutes');
// const protectedRoutes= require('./middleware/protectedRoutes');
// const errorRoutes= require('./routes/errorRoutes');
// const session= require('express-session');
// const checkAuthentication= require('./middleware/checkAuthentication');
// const errorMiddleware= require('./middleware/errorMiddleware');
// const mongoDbSession= require('connect-mongodb-session');
// const mongoDBStore= mongoDbSession(session);
// const sessionStore= new mongoDBStore({
// uri:'mongodb+srv://nikku876:[email protected]/BLOG?retryWrites=true&w=majority',
// databaseName:'BLOG',
// collection:'confessionSession',
// });
app.use(express.static('public'));
app.use(express.urlencoded({extended:false}));
app.use(express.json());
app.set('view engine','ejs');
// app.use(session({
// secret:'love-radhe',
// resave:false,
// saveUninitialized:false,
// store:sessionStore,
// cookie:{
// maxAge:60*60*1000,
// },
// }));
// app.use(checkAuthentication);
require('./database/db');
/** Routes Use As Middleware */
// app.use(protectedRoutes);
// app.use(baseRoutes);
// app.use(errorRoutes);
app.use(authRoutes);
// app.use(errorMiddleware);
app.listen(port,()=>{
console.log("Server is listen on :"+port);
})