File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,22 @@ import { useEffect, useMemo } from 'react'
55import { useThemeStore } from '@/stores/themeStore'
66import { Link } from 'react-router-dom'
77
8+ // Runtime environment from env.js (generated at container startup)
9+ declare global {
10+ interface Window {
11+ __ENV__ ?: {
12+ VITE_API_BASE_URL ?: string
13+ VITE_BACKEND_URL ?: string
14+ }
15+ }
16+ }
17+
818export default function ApiDocs ( ) {
919 // Get the access token from localStorage
1020 const accessToken = useMemo ( ( ) => localStorage . getItem ( 'access_token' ) , [ ] )
1121 const { isDark } = useThemeStore ( )
12- const apiBaseUrl = import . meta. env . VITE_API_BASE_URL || 'http://localhost:8081'
22+ // Use runtime config first, then build-time env, then default
23+ const apiBaseUrl = window . __ENV__ ?. VITE_API_BASE_URL || import . meta. env . VITE_API_BASE_URL || '/api'
1324
1425 useEffect ( ( ) => {
1526 // Hide the "Explore" link and customize Swagger UI colors
You can’t perform that action at this time.
0 commit comments