-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
48 lines (25 loc) · 811 Bytes
/
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
const express = require('express');
const port = 3000;
const app = express();
const connectDB = require("./db");
const ejs = require( 'ejs' );
const path = require('path');
connectDB();
const { validateCookie } = require('./middlewares/auth');
app.use(express.json());
const cookieParser = require("cookie-parser");
app.use(cookieParser());
app.set("view engine", "ejs");
app.set("views", path.resolve("./views"));
app.use("/api/auth", require('./routes/auth'));
app.use("/api/doubt", require('./routes/doubt.js'));
app.use("/api/reply", require('./routes/reply.js'));
app.use("/api/mentor", require('./routes/mentor.js'));
app.listen(port, (err,data)=>{
try{
console.log("Server is up and running!");
}
catch(err){
console.log("something is wrong!");
}
})