Add root env loading and registration config

This commit is contained in:
2026-01-15 08:39:22 +01:00
parent 2e7a6ded12
commit 25884f23a4
5 changed files with 78 additions and 12 deletions
+8 -2
View File
@@ -1,7 +1,13 @@
import { config } from 'dotenv'
import { fileURLToPath } from 'url'
import { dirname, resolve } from 'path'
// Load environment variables
config()
// Load environment variables from root directory
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const rootDir = resolve(__dirname, '../../..')
config({ path: resolve(rootDir, '.env') })
export const jwtConfig = {
secret: process.env.JWT_SECRET || 'fallback-secret-for-development',