-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
37 lines (26 loc) · 934 Bytes
/
index.ts
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
import http from 'http';
import config from './config/default';
import app from './src/lib/server';
import log from './src/lib/log';
import socket from './src/lib/socket';
import serviceHelper from './src/services/serviceHelper';
import databaseService from './src/services/databaseIndexCreationService';
import ratesService from './src/services/ratesService';
import networkFeesService from './src/services/networkFeesService';
const server = http.createServer(app);
ratesService.initRates();
socket.initIOKey(server);
socket.initIOWallet(server);
log.info('Initiating database');
serviceHelper.initiateDB();
setTimeout(() => {
log.info('Preparing indexes');
databaseService.doIndexes(); // no waiting
}, 2000);
networkFeesService.fetchFees();
setTimeout(() => {
log.info('Starting SSP Relay');
server.listen(config.server.port, () => {
log.info(`App listening on port ${config.server.port}`);
});
}, 4000);