Files
fast_api_template/frontend/tests/config.ts
T

20 lines
569 B
TypeScript
Raw Normal View History

2024-08-01 13:01:03 -05:00
import path from "node:path"
import { fileURLToPath } from "node:url"
import dotenv from "dotenv"
2024-08-01 13:01:03 -05:00
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
2024-08-01 13:01:03 -05:00
dotenv.config({ path: path.join(__dirname, "../../.env") })
2025-12-07 13:21:13 +01:00
function getEnvVar(name: string): string {
const value = process.env[name]
if (!value) {
throw new Error(`Environment variable ${name} is undefined`)
}
return value
}
2025-12-07 13:21:13 +01:00
export const firstSuperuser = getEnvVar("FIRST_SUPERUSER")
export const firstSuperuserPassword = getEnvVar("FIRST_SUPERUSER_PASSWORD")