import app from './app.js'; import { config } from './config.js'; import { logger } from './framework/logging.js'; // If your application is deployed with more than 1 vCPU you can delete this // file and use a clustering utility to run `lib/app`. const listener = app.listen(config.port, () => { const address = listener.address(); if (typeof address === 'object' && address) { logger.debug(`listening on port ${address.port}`); } }); // Gantry ALB default idle timeout is 30 seconds // https://nodejs.org/docs/latest-v18.x/api/http.html#serverkeepalivetimeout // Node default is 5 seconds // https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html#connection-idle-timeout // AWS recommends setting an application timeout larger than the load balancer listener.keepAliveTimeout = 31000; // Report unhandled rejections instead of crashing the process // Make sure to monitor these reports and alert as appropriate process.on('unhandledRejection', (err) => logger.error(err, 'Unhandled promise rejection'), );