-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
38 lines (24 loc) · 1.02 KB
/
server.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
const express = require('express');
const bodyParser = require('body-parser');
const accounts = require('./routes/api/accounts');
const ads = require('./routes/api/ads');
const settings = require('./routes/api/settings');
const jobs = require('./routes/api/jobs');
const members = require('./routes/api/members');
const drivers = require('./routes/api/drivers');
const ewallet = require('./routes/api/ewallet');
const bid = require('./routes/api/bid');
const app = express(); //boilerplate: initialize express into app
// boilerplate: bodyparser middleware
app.use(bodyParser.json());
app.use('/api/accounts', accounts);
app.use('/api/ads', ads);
app.use('/api/settings', settings);
app.use('/api/jobs', jobs);
app.use('/api/members', members);
app.use('/api/drivers', drivers);
app.use('/api/ewallet', ewallet);
app.use('/api/bid', bid);
// the first part is if you want to deploy
const port = process.env.PORT || 5000;
app.listen(port, () => console.log(`Server started port ${port}`));