-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
44 lines (39 loc) · 1.19 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
require("dotenv").config()
const express = require("express")
const app = express()
const logger = require("morgan")
const bodyParser = require("body-parser")
const cors = require("cors")
const serverPORT = 3306
const PORT = process.env.PORT || serverPORT
//add cloudinary config
const { cloudinaryConfig } = require("./src/config/cloudinaryConfig")
const AuthRoute = require("./src/routes/auth")
const UserRoute = require("./src/routes/user")
const PartnerRoute = require("./src/routes/partner")
const RoomRoute = require("./src/routes/rooms")
const RegionsRoute = require("./src/routes/regions")
const BookingRoute = require("./src/routes/booking")
const PaymentRoute = require("./src/routes/payment")
app.listen(PORT, () => {
console.log(`Server is running on port: ${PORT}`)
})
app.use("*", cloudinaryConfig)
app.use(cors())
app.use(logger("dev"))
app.use(bodyParser.json())
app.use(
bodyParser.urlencoded({
extended: false
})
)
// Route for Auth
app.use("/", AuthRoute)
// Rouute for User
app.use("/user", UserRoute)
// Route for Partner
app.use("/partner", PartnerRoute)
app.use("/rooms", RoomRoute)
app.use("/regions", RegionsRoute)
app.use("/booking", BookingRoute)
app.use("/payment", PaymentRoute)