first rewrite commit

This commit is contained in:
fuomag9
2025-10-31 20:08:28 +01:00
parent 85d3917f08
commit 315192fb54
605 changed files with 10913 additions and 47794 deletions
+15
View File
@@ -0,0 +1,15 @@
import crypto from "node:crypto";
function requireEnv(name: string, fallback?: string): string {
const value = process.env[name] ?? fallback;
if (!value) {
throw new Error(`Missing required environment variable ${name}`);
}
return value;
}
export const config = {
sessionSecret: requireEnv("SESSION_SECRET", process.env.NODE_ENV === "development" ? crypto.randomBytes(32).toString("hex") : undefined),
caddyApiUrl: process.env.CADDY_API_URL ?? "http://caddy:2019",
baseUrl: process.env.BASE_URL ?? "http://localhost:3000"
};