-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprod.js
33 lines (21 loc) · 833 Bytes
/
prod.js
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
29
30
31
// Node entrypoint for production
const utils = require('./src/utils.js')
process.env.IMFT_ENV = utils.config.env ?? "production";
process.env.IMFT_VERSION = utils.config.version ?? "vUnknown"
const { logger } = require('./src/logger.js')
const adsb = require('./src/adsb.js')
const {database} = require('./src/database.js')
var { } = require('./src/sockets.js');
const { twitter } = require('./src/twitter.js');
logger.info(process.env.IMFT_VERSION + ": " + process.env.IMFT_ENV)
logger.info("Production server started")
// Detect if server is exiting from keyboard interrupt
process.on('SIGINT', async () => {
logger.info("Server stopping...");
await database.disconnect();
logger.info("Server stopped");
process.exit();
});
twitter.read_only = true;;
adsb.receiver = new adsb.OpenSky();
adsb.receiver.start();