/
server.js
35 lines (26 loc) · 928 Bytes
/
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
'use strict';
const Composer = require('./index');
const Config = require('./config');
const GithubUpdater = require('./scripts/githubUpdateStarter');
const StatsUpdater = require('./scripts/statsUpdateStarter');
//Variables that decide what should be run in this instance
const runServer = Config.get('/run/server');
const runMappingsUpdater = Config.get('/run/githubUpdater/mappings');
const runOntologyUpdater = Config.get('/run/githubUpdater/ontology');
const runStatsUpdater = Config.get('/run/statsUpdater');
Composer((err, server) => {
if (err) {
throw err;
}
if (runServer){
server.start(() => {
console.log('Started the server on port ' + server.info.port);
});
}
if (runMappingsUpdater || runOntologyUpdater ) {
GithubUpdater.start(runMappingsUpdater,runOntologyUpdater);
}
if (runStatsUpdater) {
StatsUpdater.start();
}
});