added script to run with .env

This commit is contained in:
2026-06-04 18:45:27 +02:00
parent 1af79461b1
commit 7045e3dfd1
4 changed files with 23 additions and 0 deletions
+9
View File
@@ -1,4 +1,13 @@
type WindowWithEnv = Window & {
__ENV?: {
VITE_BACKEND_URL?: string;
};
};
const runtimeEnv = (globalThis as unknown as WindowWithEnv).__ENV;
export const API_BASE =
runtimeEnv?.VITE_BACKEND_URL ||
(import.meta as any).env?.VITE_BACKEND_URL ||
import.meta.env.VITE_BACKEND_URL ||
"http://localhost:8004";