mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-29 16:56:07 +00:00
Merge branch 'master' into dev
This commit is contained in:
commit
ad750ef3d9
|
@ -14,6 +14,7 @@ interface Config {
|
|||
CORS_PROXY_URL: string;
|
||||
NORMAL_ROUTER: boolean;
|
||||
BACKEND_URL: string;
|
||||
DISALLOWED_IDS: string;
|
||||
}
|
||||
|
||||
export interface RuntimeConfig {
|
||||
|
@ -25,6 +26,7 @@ export interface RuntimeConfig {
|
|||
NORMAL_ROUTER: boolean;
|
||||
PROXY_URLS: string[];
|
||||
BACKEND_URL: string;
|
||||
DISALLOWED_IDS: 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,
|
||||
NORMAL_ROUTER: import.meta.env.VITE_NORMAL_ROUTER,
|
||||
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)
|
||||
|
@ -62,5 +65,8 @@ export function conf(): RuntimeConfig {
|
|||
.split(",")
|
||||
.map((v) => v.trim()),
|
||||
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
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue