| import app from "./api/index.js"; | |
| const PORT = process.env.PORT || 3000; | |
| const srv = app.listen(PORT, () => console.log(`[PROXY-SRV] listening on :${PORT}`)); // bind HTTP server | |
| srv.on("error", (e) => { console.error(`[PROXY-SRV] listen error:`, e); process.exit(1); }); // fatal bind failure | |
| process.on("uncaughtException", (e) => console.error(`[PROXY-SRV] uncaughtException:`, e)); // surface crashes | |
| process.on("unhandledRejection", (e) => console.error(`[PROXY-SRV] unhandledRejection:`, e)); // surface leaked async errors | |
| process.on("warning", (w) => console.warn(`[PROXY-SRV] warning:`, w.name, w.message)); // surface node warnings | |