GeminiBot commited on
Commit ·
6aa271e
1
Parent(s): 50bb115
Prevent server crash on unhandled exceptions
Browse files118 unmodified lines119120121122123124118 unmodified lines}});server.listen(PORT, () => {log(`API Gateway started on port ${PORT}`);});118 unmodified lines119120121122123124125126127128129130131132133118 unmodified lines}});// Prevent server from crashingprocess.on('uncaughtException', (err) => {log(`CRITICAL: Uncaught Exception: ${err.message}\n${err.stack}`);});process.on('unhandledRejection', (reason, promise) => {log(`CRITICAL: Unhandled Rejection: ${reason}`);});server.listen(PORT, () => {log(`API Gateway started on port ${PORT}`);});
src/server.ts+9