-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
27 lines (21 loc) · 899 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
const express = require('express');
const bodyParser = require('body-parser');
const userRouter = require('./Router/userRouter');
const productRouter = require('./Router/productRouter');
const orderRouter = require('./Router/orderRouter');
const reviewRouter = require('./Router/reviewRouter');
const accountRouter = require('./Router/accountRouter');
const cartRouter = require('./Router/cartRouter');
const promocodeRouter = require('./Router/promocodeRouter');
const app = express();
app.use(bodyParser.json());
app.use(express.static(`${__dirname}/public}`));
//routers
app.use('/api/v1/user', userRouter);
app.use('/api/v1/products', productRouter);
app.use('/api/v1/orders', orderRouter);
app.use('/api/v1/reviews', reviewRouter);
app.use('/api/v1/accountDetails', accountRouter);
app.use('/api/v1/cart', cartRouter);
app.use('/api/v1/promocode', promocodeRouter);
module.exports = app;