generated from pesto-students/PESTO_NINJA-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
57 lines (50 loc) · 2.03 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
56
57
const express = require('express')
const cors = require("cors")
const cookieSession = require('cookie-session');
const connectDb = require("./server/database/dbConnect")
const app = express();
const bodyParser = require('body-parser')
const UserRoute = require('./server/routes/user')
const StudentRoute = require('./server/routes/student')
const InterviewerRoute = require('./server/routes/interviewer')
const ApplicationReviewRoute = require('./server/routes/applicationReview')
const DashbaordRoute = require('./server/routes/dashboard')
const AdminDashbaordRoute = require('./server/routes/adminDashboard')
const PricingRoute = require('./server/routes/pricing')
const TopicRoute = require('./server/routes/topic')
const ResourceRoute = require('./server/routes/resource')
const RazorpayRoute = require('./server/routes/razorpay')
const InterviewsRoute = require('./server/routes/interviews')
const QuizRoute = require('./server/routes/quiz')
const QueryRoute = require('./server/routes/query')
const AuthRoute = require('./server/routes/auth')
const StudentQueryRoute = require('./server/routes/studentquery')
app.use(cors())
app.use(express.static("public"));
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(cookieSession({
name: 'google-auth-session',
keys: ['key1', 'key2']
}))
app.use('/user', UserRoute)
app.use('/student', StudentRoute)
app.use('/interviewer', InterviewerRoute)
app.use('/appReview', ApplicationReviewRoute)
app.use("/dashboard", DashbaordRoute)
app.use("/adminDashboard", AdminDashbaordRoute)
app.use("/pricing", PricingRoute)
app.use("/topic", TopicRoute)
app.use("/resource",ResourceRoute)
app.use("/quiz",QuizRoute)
app.use("/auth",AuthRoute)
app.use("/query", QueryRoute)
app.use("/razorpay", RazorpayRoute)
app.use("/interviews", InterviewsRoute)
app.use("/studentQuery", StudentQueryRoute)
const PORT = process.env.PORT||'8080';
app.listen(PORT, () => {
console.log(`Mock Prep listening on port ${PORT}!`)
});
app.get("/", (req, res) => { res.send("Welcome to Mock Prep !!")})
connectDb();