Address architecture + stability review (todo §0): wire buildContext, graceful shutdown, prod template caching

This commit is contained in:
2026-06-15 08:42:16 +02:00
parent 0bc7998cfe
commit 17f4411518
5 changed files with 37 additions and 4 deletions

View File

@@ -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)));
}