-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
43 lines (34 loc) · 1.35 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
39
40
41
42
43
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const DbService = require('./src/app/service/database.service')
const FeatureService = require('./src/app/service/feature.service')
const Common = require('./src/app/utils/common')
const Logger = require('./src/app/service/logging.service')('server')
const port = process.env.PORT || 8000;
const app = express();
app.use(cors());
app.options('*', cors());
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(bodyParser.raw());
//Registering Controller
app.use('/util', require('./src/app/controller/utility.controller'));
app.use('/auth', require('./src/app/controller/auth.controller'));
app.use('/mail', require('./src/app/controller/email.controller'));
app.use('/api', require('./src/app/controller/queries.controller'));
app.use('/order', require('./src/app/controller/order.controller'));
app.listen(port, () => {
Logger.info(`Example app listening on port ${port}!`)
});
const bootstrap = () => {
Logger.info('Loading configuration ', new Date().toISOString())
Common.setupConfiguration()
setTimeout(() => {
Logger.info('Seeding starts now ', new Date().toISOString())
FeatureService.populateFeatureFlags();
DbService.make();
DbService.seed();
}, 1000)
}
bootstrap();