mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:37:07 +00:00
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.
19 lines
447 B
JavaScript
Executable File
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();
|