import app from "./app"; import { logger } from "./lib/logger"; const PORT = Number(process.env["PORT"] ?? 7860); // The Python model daemon is managed exclusively by routes/model.ts // (startModelDaemon). Do NOT start a second copy here — dual spawns on the // same port cause one to fail to bind, which breaks the health-check probe and // prevents _daemonReady from ever becoming true. // ====================== START SERVER ====================== app.listen(PORT, () => { logger.info({ port: PORT }, "Server listening"); console.log(`[api-server] Running on port ${PORT}`); }); process.on("SIGTERM", () => { process.exit(0); });