Address architecture + stability review (todo §0): wire buildContext, graceful shutdown, prod template caching
This commit is contained in:
@@ -3,6 +3,11 @@ import { loadConfig } from "./config.ts";
|
||||
|
||||
const { port } = loadConfig(); // validates the env (incl. prod secrets) — fails loud at boot
|
||||
|
||||
createApp().listen(port, () => {
|
||||
const server = createApp().listen(port, () => {
|
||||
console.log(`Listening on http://localhost:${port}`);
|
||||
});
|
||||
|
||||
// Drain in-flight requests on container stop instead of cutting them mid-response.
|
||||
for (const signal of ["SIGINT", "SIGTERM"] as const) {
|
||||
process.on(signal, () => server.close(() => process.exit(0)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user