-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
34 lines (30 loc) · 1023 Bytes
/
server.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
const express = require("express");
const cors = require("cors");
const cityRoutes = require("./routes/cityRoutes");
const schoolRoutes = require("./routes/schoolRoutes");
const studentRoutes = require("./routes/studentRoutes");
const userRoutes = require("./routes/userRoutes");
const adminRoutes = require("./routes/adminRoutes");
const authorityRoutes = require("./routes/authorityRoutes");
const analysisRoutes = require("./routes/analysisRoute");
const reasonRoutes = require("./routes/reasonRoutes");
const app = express();
//dbconnection
require("./config/dbconfig").getDbconnection();
//middleware
app.use(express.static("public"));
app.use(express.json());
app.use(cors());
app.use("/", analysisRoutes);
app.use("/", cityRoutes);
app.use("/", schoolRoutes);
app.use("/", studentRoutes);
app.use("/", userRoutes);
app.use("/", adminRoutes);
app.use("/", authorityRoutes);
app.use("/", reasonRoutes);
app.get("/", (req, res) => {
res.send("hello");
});
app.listen(9999);
console.log("server started at 9999");