-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (23 loc) · 807 Bytes
/
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
const express = require('express');
const database = require('./database/database')
const bodyParser = require('body-parser');
const accountRoute = require('./routes/accountRoute');
const productRoute = require('./routes/productRoute');
const bookingRoute = require('./routes/bookingRoute')
const ratingRoute = require('./routes/ratingRoute');
const cors = require('cors')
const path = require("path")
const app = express();
app.use(bodyParser.urlencoded({ extended: false }))
app.use(express.json());
app.use("/images", express.static(path.join(__dirname, "images")))
app.use(cors())
app.use((req, res, next) => {
console.log(req.body)
next()
})
app.use("/api/account", accountRoute);
app.use("/api", productRoute);
app.use("/api", bookingRoute)
app.use("/api", ratingRoute);
app.listen(90);