2024-08-01 13:01:03 -05:00
|
|
|
import path from "node:path"
|
|
|
|
|
import { fileURLToPath } from "node:url"
|
|
|
|
|
import dotenv from "dotenv"
|
2024-07-23 14:59:39 -05:00
|
|
|
|
2024-08-01 13:01:03 -05:00
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
|
|
|
const __dirname = path.dirname(__filename)
|
2024-07-23 14:59:39 -05:00
|
|
|
|
2024-08-01 13:01:03 -05:00
|
|
|
dotenv.config({ path: path.join(__dirname, "../../.env") })
|
2024-07-23 14:59:39 -05:00
|
|
|
|
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
|
2024-07-23 14:59:39 -05:00
|
|
|
}
|
|
|
|
|
|
2025-12-07 13:21:13 +01:00
|
|
|
export const firstSuperuser = getEnvVar("FIRST_SUPERUSER")
|
|
|
|
|
export const firstSuperuserPassword = getEnvVar("FIRST_SUPERUSER_PASSWORD")
|