Files
dougal-software/lib/www/server/index.js
D. Berge 940aea8c7b Run events manager in a separate process.
Not sure if this is going to do anything in
terms of improving the handling of and reacting
to events, but it doesn't seem to hurt terribly.

Eventually, all this will probably need to be
refactored to use EventEmitter.
2020-10-02 01:34:49 +02:00

19 lines
447 B
JavaScript
Executable File

#!/usr/bin/node
const api = require('./api');
const ws = require('./ws');
const { fork } = require('child_process');
// const em = require('./events');
const server = api.start(process.env.HTTP_PORT || 3000, process.env.HTTP_PATH);
ws.start(server);
const eventManagerPath = [__dirname, "events"].join("/");
const eventManager = fork(eventManagerPath, /*{ stdio: 'ignore' }*/);
process.on('exit', () => eventManager.kill());
// em.start();