-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
29 lines (23 loc) · 889 Bytes
/
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
const http = require('http');
const config = require('config');
const app = require('./src/lib/server');
const log = require('./src/lib/log');
const serviceHelper = require('./src/services/serviceHelper');
const databaseService = require('./src/services/databaseIndexCreationService');
const server = http.createServer(app);
log.info('Initiating database');
serviceHelper.initiateDB();
setTimeout(() => {
log.info('Preparing indexes');
databaseService.doEnvIndexes(); // no waiting
databaseService.doCmdIndexes(); // no waiting
databaseService.doPublicIndexes(); // no waiting
databaseService.doContactsIndexes(); // no waiting
databaseService.doNotificationsIndexes(); // no waiting
}, 2000);
setTimeout(() => {
log.info('Starting Flux Storage');
server.listen(config.server.port, () => {
log.info(`App listening on port ${config.server.port}`);
});
}, 4000);