-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (31 loc) · 955 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
import express from "express";
import cors from 'cors';
import dotenv from "dotenv";
import ConnectDB from "./Database/config.js";
import planrouter from "./Routes/Plans.js";
import bookingrouter from "./Routes/Booking.js";
import settlementrouter from "./Routes/Settlement.js";
import loginrouter from "./Routes/Login.js";
import feedbackrouter from "./Routes/Feedback.js";
import paymentrouter from "./Routes/payment.js";
const app= express();
dotenv.config();
app.use(express.json());
app.use(cors());
//DB Connection
ConnectDB()
//Routes
app.use("/plans",planrouter);
app.use("/booking",bookingrouter);
app.use("/settlement",settlementrouter);
app.use("/feedback",feedbackrouter);
app.use("/logincrediential",loginrouter);
app.use("/payment",paymentrouter)
//Connection
app.get('/',(req,res)=>{
res.status(200).send("api connection done");
})
// PORT Access
app.listen(process.env.PORT,()=>{
console.log("app running sucessfully");
})