-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (22 loc) · 711 Bytes
/
app.js
File metadata and controls
29 lines (22 loc) · 711 Bytes
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
const { urlencoded } = require('express')
const express = require('express')
const path = require('path')
const app = express()
const db = require('./models/bundle.model')
app.use('/assets/images', express.static(path.join(__dirname, 'public')))
app.use(express.json())
app.use(urlencoded({ extended: false }))
try {
db.sequelize.sync({ force: false })
} catch (error) {
}
/* Product */
const productRouter = require('./routes/product')
app.use('/product', productRouter)
/* Category */
const categoryRouter = require('./routes/category')
app.use('/category', categoryRouter)
/* Frontend */
const frontendRouter = require('./routes/frontend')
app.use('/frontend', frontendRouter)
module.exports = app