Add env/config loader (todo §0); validate at boot, wire port into server

This commit is contained in:
2026-06-14 19:46:26 +02:00
parent 3b2ba76530
commit 0bc7998cfe
5 changed files with 138 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import { createApp } from "./app.ts";
import { loadConfig } from "./config.ts";
const port = Number(process.env["PORT"] ?? 3000);
const { port } = loadConfig(); // validates the env (incl. prod secrets) — fails loud at boot
createApp().listen(port, () => {
console.log(`Listening on http://localhost:${port}`);