Files
LaunchPad/apps/backend/src/env.ts

12 lines
532 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { config } from "dotenv";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
const currentDir = dirname(fileURLToPath(import.meta.url));
// apps/backend/src/env.ts (bzw. apps/backend/dist/env.js) -> Repo-Root liegt
// drei Verzeichnisebenen höher. Existiert dort keine .env (z. B. im
// Docker-Image), passiert einfach nichts die Werte kommen dann bereits aus
// der Container-Umgebung (docker-compose env_file/environment).
config({ path: resolve(currentDir, "../../../.env") });