-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
42 lines (23 loc) · 815 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
const express = require("express");
const app = express();
require("dotenv").config();
const cookieParser = require("cookie-parser")
const {PORT} = process.env;
require("./config/dbConnect").dbConnect();
//middlewares
app.use(express.json());
app.use(express.urlencoded({extended : true}));
app.use(cookieParser());
//import routes
const userRouter = require("./router/userRouter");
const patientRouter = require("./router/patientRouter");
const adminRouter = require("./router/adminRouter");
const doctorRouter = require("./router/doctorRouter");
//routes
app.use("/api/v1/user", userRouter);
app.use("/api/v1/patient", patientRouter);
app.use("/api/v1/admin", adminRouter);
app.use("/api/v1/doctor", doctorRouter);
app.listen(PORT, ()=>{
console.log(`Server is running on port ${PORT}`);
})