-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (26 loc) · 1013 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
const express = require("express");
const cors = require("cors");
require("dotenv").config();
const { dbConnection, client } = require("./Utils/DBConnect");
const UserRoute = require("./Routes/user.route");
const AppointmentRoute = require("./Routes/appointment.route");
const SlotRoute = require("./Routes/slot.route");
const BookingRoute = require("./Routes/booking.route");
const JwtRoute = require("./Routes/jwt.route");
const paymentRoute = require("./Routes/payment.route");
const http = require("http");
const port = process.env.PORT || 5006;
const app = express();
app.use(cors());
app.use(express.json());
const server = http.createServer(app);
app.use("/api/v1", UserRoute);
app.use("/api/v1", AppointmentRoute);
app.use("/api/v1", SlotRoute);
app.use("/api/v1", BookingRoute);
app.use("/api/v1", JwtRoute);
app.use("/api/v1", paymentRoute);
app.get("/", async (req, res) => {
res.send("Doctors Portal Server Running");
});
server.listen(port, () => console.log(`server is running on port ${port}`));