You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aruppi-api/src/index.js

21 lines
536 B
JavaScript

const app = require('./app');
const port = process.env.PORT || 5000;
const addr = isNaN(port) ?
'' :
(process.env.ADDR || '0.0.0.0');
server = app.listen(port, addr, () => {
/* eslint-disable no-console */
console.log(`\n🚀 ... Listening: ${addr}${addr ? '\:' : 'unix://'}${port}`);
/* eslint-enable no-console */
});
function shutdown() {
server.close(); // socket file is automatically removed here
process.exit();
}
process.on('SIGINT', shutdown);
process.on('SIGQUIT', shutdown);
process.on('SIGTERM', shutdown);