-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
63 lines (54 loc) · 2.34 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
const config = require('./config/config.js');
app.use(bodyParser.json());
// also allow localhost for testing
// allow multiple origins
// app.use(cors({ origin: 'http://localhost:3000' }));
app.use(cors({ origin: 'http://localhost:3000' }));
const port = process.env.PORT || 5000;
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
const staff = require('./routes/staff');
const customers = require('./routes/customers.js');
const products = require('./routes/products.js');
const transactions = require('./routes/transactions.js');
const categories = require('./routes/categories.js');
const discounts = require('./routes/discounts.js');
const locations = require('./routes/locations.js');
const roles = require('./routes/roles.js');
const subscriptions = require('./routes/subscriptions.js');
const subscriptionTypes = require('./routes/subscriptionTypes.js');
const terminals = require('./routes/terminals.js');
const transactionStatus = require('./routes/transactionStatus.js');
const transactionTypes = require('./routes/transactionTypes.js');
const events = require('./routes/events.js');
const transfers = require('./routes/transfers.js');
const transferTypes = require('./routes/transferTypes.js');
const transferItems = require('./routes/transferItems.js');
const stock = require('./routes/stock.js');
const eventCounts = require('./routes/eventCounts.js');
const functions = require('./routes/functions.js');
app.use('/api/staff', staff);
app.use('/api/customers', customers);
app.use('/api/products', products);
app.use('/api/transactions', transactions);
app.use('/api/categories', categories);
app.use('/api/discounts', discounts);
app.use('/api/locations', locations);
app.use('/api/roles', roles);
app.use('/api/subscriptions', subscriptions);
app.use('/api/subscriptionTypes', subscriptionTypes);
app.use('/api/terminals', terminals);
app.use('/api/transactionStatus', transactionStatus);
app.use('/api/transactionTypes', transactionTypes);
app.use('/api/events', events);
app.use('/api/transfers', transfers);
app.use('/api/transferTypes', transferTypes);
app.use('/api/transferItems', transferItems);
app.use('/api/stock', stock);
app.use('/api/eventCounts', eventCounts);
app.use('/api/functions', functions);