-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
37 lines (31 loc) · 1022 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
const express = require("express");
const cors = require("cors");
const bodyParser = require("body-parser");
const { dbSync } = require("./db");
const createDishTypes = require("./dishTypeData");
const createLocations = require("./locationData");
const dishRouter = require("./dish-table/routes");
const typeRouter = require("./type-table/routes");
const menuRouter = require("./menu-table/routes");
const googleRouter = require("./google/routes");
const locationRouter = require("./location-table/routes");
const app = express();
const port = process.env.PORT || 5000;
require("./modelRelations");
// Dishes data for location 6 - used only for testing.
//require("./dishesData");
dbSync().then(() => {
console.log("Connected to database");
createDishTypes();
createLocations();
});
app
.use(cors())
.use(bodyParser.json())
.use(dishRouter)
.use(typeRouter)
.use(menuRouter)
.use(googleRouter)
.use(locationRouter);
app.listen(port, console.log(`listen to port ${port}`));
console.log("TEST2");