|
|
@ -14,6 +14,7 @@ interface Config { |
|
|
|
CORS_PROXY_URL: string; |
|
|
|
CORS_PROXY_URL: string; |
|
|
|
NORMAL_ROUTER: boolean; |
|
|
|
NORMAL_ROUTER: boolean; |
|
|
|
BACKEND_URL: string; |
|
|
|
BACKEND_URL: string; |
|
|
|
|
|
|
|
DISALLOWED_IDS: string; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export interface RuntimeConfig { |
|
|
|
export interface RuntimeConfig { |
|
|
@ -25,6 +26,7 @@ export interface RuntimeConfig { |
|
|
|
NORMAL_ROUTER: boolean; |
|
|
|
NORMAL_ROUTER: boolean; |
|
|
|
PROXY_URLS: string[]; |
|
|
|
PROXY_URLS: string[]; |
|
|
|
BACKEND_URL: string; |
|
|
|
BACKEND_URL: string; |
|
|
|
|
|
|
|
DISALLOWED_IDS: string[]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const env: Record<keyof Config, undefined | string> = { |
|
|
|
const env: Record<keyof Config, undefined | string> = { |
|
|
@ -36,6 +38,7 @@ const env: Record<keyof Config, undefined | string> = { |
|
|
|
CORS_PROXY_URL: import.meta.env.VITE_CORS_PROXY_URL, |
|
|
|
CORS_PROXY_URL: import.meta.env.VITE_CORS_PROXY_URL, |
|
|
|
NORMAL_ROUTER: import.meta.env.VITE_NORMAL_ROUTER, |
|
|
|
NORMAL_ROUTER: import.meta.env.VITE_NORMAL_ROUTER, |
|
|
|
BACKEND_URL: import.meta.env.VITE_BACKEND_URL, |
|
|
|
BACKEND_URL: import.meta.env.VITE_BACKEND_URL, |
|
|
|
|
|
|
|
DISALLOWED_IDS: import.meta.env.VITE_DISALLOWED_IDS, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// loads from different locations, in order: environment (VITE_{KEY}), window (public/config.js)
|
|
|
|
// loads from different locations, in order: environment (VITE_{KEY}), window (public/config.js)
|
|
|
@ -62,5 +65,8 @@ export function conf(): RuntimeConfig { |
|
|
|
.split(",") |
|
|
|
.split(",") |
|
|
|
.map((v) => v.trim()), |
|
|
|
.map((v) => v.trim()), |
|
|
|
NORMAL_ROUTER: getKey("NORMAL_ROUTER", "false") === "true", |
|
|
|
NORMAL_ROUTER: getKey("NORMAL_ROUTER", "false") === "true", |
|
|
|
|
|
|
|
DISALLOWED_IDS: getKey("DISALLOWED_IDS", "") |
|
|
|
|
|
|
|
.split(",") |
|
|
|
|
|
|
|
.map((v) => v.trim()), // Should be comma-seperated and contain the media type and ID, formatted like so: movie-753342,movie-753342,movie-753342
|
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|