2020-09-13 15:35:36 +02:00
|
|
|
#!/usr/bin/node
|
2020-08-08 23:59:13 +02:00
|
|
|
|
|
|
|
|
const api = require('./api');
|
2020-09-03 14:04:29 +02:00
|
|
|
const ws = require('./ws');
|
2020-10-02 01:34:49 +02:00
|
|
|
|
|
|
|
|
const { fork } = require('child_process');
|
|
|
|
|
|
|
|
|
|
// const em = require('./events');
|
2020-08-08 23:59:13 +02:00
|
|
|
|
2020-09-03 14:04:29 +02:00
|
|
|
const server = api.start(process.env.HTTP_PORT || 3000, process.env.HTTP_PATH);
|
|
|
|
|
ws.start(server);
|
2020-10-02 01:34:49 +02:00
|
|
|
|
|
|
|
|
const eventManagerPath = [__dirname, "events"].join("/");
|
|
|
|
|
const eventManager = fork(eventManagerPath, /*{ stdio: 'ignore' }*/);
|
|
|
|
|
|
|
|
|
|
process.on('exit', () => eventManager.kill());
|
|
|
|
|
|
|
|
|
|
// em.start();
|