This runs without error:
const app = express();const server = app.listen(3900, '0.0.0.0', () => { console.log('listening...');});process.once('SIGINT', () => { console.log('got SIGINT.') setTimeout(() => { console.log('ending process due to SIGINT + subsequent Timeout.') process.exit(0); }, 3000); server.closeIdleConnections(); // <<< server.closeAllConnections(); // <<<< server.close(err => { if (err) { console.error(err); } console.log('closed server, and now shutting down due to SIGINT.') process.exit(0); });});
but my question is - is this the best way to stop accepting new connections before ending the existing connections/requests?
how are "idle" connections defined?