forked from CNXTEoEorg/origami-navigation-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (24 loc) · 597 Bytes
/
index.js
File metadata and controls
28 lines (24 loc) · 597 Bytes
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
'use strict';
const dotenv = require('dotenv');
const navigationService = require('./lib/navigation-service');
const throng = require('throng');
dotenv.config({
silent: true
});
const options = {
defaultLayout: 'main',
log: console,
name: 'Origami Navigation Service',
testHealthcheckFailure: process.env.TEST_HEALTHCHECK_FAILURE || false,
workers: process.env.WEB_CONCURRENCY || 1
};
throng({
workers: options.workers,
start: startWorker
});
function startWorker(id) {
console.log(`Started worker ${id}`);
navigationService(options).listen().catch(() => {
process.exit(1);
});
}