fix api url setup
This commit is contained in:
+3
-1
@@ -4,5 +4,7 @@
|
|||||||
* At build time (dev / CI), values come from import.meta.env.
|
* At build time (dev / CI), values come from import.meta.env.
|
||||||
*/
|
*/
|
||||||
export function env(key: string): string | undefined {
|
export function env(key: string): string | undefined {
|
||||||
return (window as Record<string, any>).__env__?.[key] ?? (import.meta.env as Record<string, any>)[key]
|
const runtime = (window as Record<string, any>).__env__?.[key]
|
||||||
|
if (runtime) return runtime
|
||||||
|
return (import.meta as any).env?.[key]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user