-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
51 lines (44 loc) · 1.4 KB
/
app.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
const express = require("express")
const app = express()
const fileUpload = require("express-fileupload")
const cookieParser = require("cookie-parser")
const userRoute = require("./routers/user")
const leaveRoute = require("./routers/leave")
const attendanceRoute = require("./routers/attendance")
const timeTable = require("./routers/timetable")
const sittingArrangement = require("./routers/sittingArranagment")
const homework =require("./routers/homework")
const payment = require("./routers/payment")
const examResult = require("./routers/examResult")
const department = require("./routers/department")
const section = require("./routers/section")
var cors = require('cors')
app.use(express.json());
app.use(cors())
app.use(express.urlencoded({ extended: true}));
app.use(express.json());
app.set("view engine", "ejs");
app.use(fileUpload({
useTempFiles : true,
tempFileDir : '/tmp/'
}));
app.use(cookieParser())
app.use(express.json())
app.get("/",(req,res)=>{
res.send("hello")
})
app.get("/signuptest", function (req, res) {
res.render("signuptest");
});
//api route
app.use("/api/v1",userRoute)
app.use("/api/v1",leaveRoute)
app.use("/api/v1",attendanceRoute)
app.use("/api/v1",homework)
app.use("/api/v1",sittingArrangement)
app.use("/api/v1",timeTable)
app.use("/api/v1",payment)
app.use("/api/v1",examResult)
app.use("/api/v1",department)
app.use("/api/v1",section)
module.exports = app;