repo3 / server.js
agent
port opencode-proxy into repo3
66ddfbe
Raw
History Blame Contribute Delete
643 Bytes
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