-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
41 lines (26 loc) · 981 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
31
32
33
34
35
36
37
38
require("dotenv").config();
const express = require('express');
const app = express();
const port = process.env.APP_PORT || 3000;
const cors = require('cors');
// const initRoutes = require("../../Angular/Client cafe/src/routes/web");
global.__basedir = __dirname;
app.use(cors("*"))
app.listen(port, () => {
console.log("server is running");
})
app.use(express.urlencoded({ extended: true }))
app.use(express.json())
require('./models/index')
const ReservationRouter = require('./routes/reservationRoutes');
app.use('/api', ReservationRouter)
const itemNoRoutes = require('./routes/itemNoRoutes');
app.use('/api', itemNoRoutes)
const cartRoutes = require('./routes/cartRoutes');
app.use('/api', cartRoutes)
const userRoutes = require('./routes/userRoutes');
app.use('/api', userRoutes)
const orderRoutes = require('./routes/orderDetailsRoutes');
app.use('/api', orderRoutes)
const CafeRoutes = require('./routes/cafeDetailsRoutes');
app.use('/api', CafeRoutes)