forked from TID-Lab/aggie
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·28 lines (21 loc) · 792 Bytes
/
app.js
File metadata and controls
executable file
·28 lines (21 loc) · 792 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
process.title = 'aggie';
const processManager = require('./backend/process-manager');
require('dotenv').config();
// fork child at specific module path
function _fork(name, modulePath) {
const childProcess = processManager.fork(modulePath);
console.debug('\x1b[36m', `[${name}] started`, '\x1b[0m')
}
// handle uncaught exceptions
process.on('uncaughtException', function (err) {
console.error(err.message)
console.debug(err.stack)
});
// Begins the three main backend processes API, fetching, and analytics.
// See Readme files in backend subdirectores for more on each.
_fork('API', '/backend/api');
_fork('FETCH', '/backend/fetching');
_fork('ANALYTICS', '/backend/analytics');
// truemedia polling
_fork('TRUEMEDIA', '/backend/truemedia');
module.exports = processManager;