-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
60 lines (52 loc) · 2.06 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const adminRoute = require('./routes/admin');
const employeeRoute = require('./routes/employee');
const imageRoute = require('./routes/images');
const vehicleRoute = require('./routes/vehicle');
const routeRoute = require('./routes/route');
const assignmentRoute = require('./routes/assignment');
const productRoute = require('./routes/product');
const batchRoute = require('./routes/batch');
const commissionRoute = require('./routes/commission');
const clientRoute = require('./routes/client');
const invoiceRoute = require('./routes/invoice');
const paymentRoute = require('./routes/payment');
const vehicleInventoryRoute = require('./routes/vehicleInventory');
const fetchDataRoute = require('./routes/fetchData');
const salesRoute = require('./routes/sales');
const outstandingRoute = require('./routes/outstanding');
const dayEndRoute = require('./routes/day-end-report');
const trashRoute = require('./routes/trash');
const dashRoute = require('./routes/dashboard');
const invoiceNewRoute = require('./routes/invoice-new');
app.use(bodyParser.json());
app.use('/uploads', express.static('uploads'));
app.use("/admin", adminRoute);
app.use("/employee", employeeRoute);
app.use("/images", imageRoute);
app.use("/vehicle", vehicleRoute);
app.use("/product", productRoute);
app.use("/batch", batchRoute);
app.use("/route", routeRoute);
app.use("/assignment", assignmentRoute);
app.use("/commission", commissionRoute);
app.use("/client", clientRoute);
app.use("/invoice", invoiceRoute);
app.use("/payment", paymentRoute);
app.use("/vehicle-inventory", vehicleInventoryRoute);
app.use("/fetchdata", fetchDataRoute);
app.use("/sales", salesRoute);
app.use("/outstanding", outstandingRoute);
app.use("/day-report", dayEndRoute);
app.use("/trash", trashRoute);
app.use("/dashboard", dashRoute);
app.use("/invoice-new", invoiceNewRoute);
app.get('/time', (req, res) => {
res.send(new Date().toString());
});
app.get('/', (req, res) => {
res.send('Server is working');
});
module.exports = app;