// Centralized environment loader
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Resolve backend/.env regardless of cwd
const envPath = path.resolve(__dirname, '../.env');

// Lade .env-Datei
const result = dotenv.config({ path: envPath });
if (result.error) {
  console.warn('[env] Konnte .env nicht laden:', result.error.message);
}

if (!process.env.SECRET_KEY) {
  console.warn('[env] SECRET_KEY nicht gesetzt in .env');
}
export {};
