-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
24 lines (21 loc) · 868 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
const express = require("express");
const app = express();
const db = require("./models");
const PORT = process.env.PORT || 3000;
const prodRoutes = require('./routes/prodRoutes.js');
const prod_attrRoutes = require('./routes/prod_attrRoutes.js');
const prod_exlocRoutes = require('./routes/prod_exlocRoutes.js');
const prod_imgRoutes = require('./routes/prod_imgRoutes.js');
const prod_invRoutes = require('./routes/prod_invRoutes.js');
app.use(express.urlencoded({extended:true}));
app.use(express.json());
db.sequelize.sync().then(() => {
app.listen(PORT, ()=>{
console.log(`listening on: http://localhost:${PORT}`);
});
});
app.use("/product",prodRoutes);
app.use("/product_attributes",prod_attrRoutes);
app.use("/product_exclusive_locations",prod_exlocRoutes);
app.use("/product_images",prod_imgRoutes);
app.use("/product_inventories",prod_invRoutes);