feat(server): add app-config core with fail-fast env validation

This commit is contained in:
jubnl
2026-07-25 15:03:27 +02:00
parent b955998905
commit 48ba9092c3
14 changed files with 1148 additions and 25 deletions
+12
View File
@@ -0,0 +1,12 @@
/**
* Side-effect module: validates the environment the moment it is imported.
*
* index.ts imports this immediately after `import 'dotenv/config'` — as a
* side-effect import (not a function call) so validation runs BEFORE the rest
* of the import graph executes its module-load side effects (config.ts key
* resolution, db/database.ts initDb, ...). A plain call in index.ts's body
* would run after all of those, because imports hoist.
*/
import { validateEnvAtBoot } from './env';
validateEnvAtBoot();