Add env/config loader (todo §0); validate at boot, wire port into server
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user