|
|
@ -1,6 +1,6 @@ |
|
|
|
import { APP_VERSION, GITHUB_LINK, DISCORD_LINK } from "@/constants"; |
|
|
|
import { APP_VERSION, GITHUB_LINK, DISCORD_LINK } from "@/constants"; |
|
|
|
|
|
|
|
|
|
|
|
export interface Config { |
|
|
|
interface Config { |
|
|
|
APP_VERSION: string; |
|
|
|
APP_VERSION: string; |
|
|
|
GITHUB_LINK: string; |
|
|
|
GITHUB_LINK: string; |
|
|
|
DISCORD_LINK: string; |
|
|
|
DISCORD_LINK: string; |
|
|
@ -9,6 +9,10 @@ export interface Config { |
|
|
|
CORS_PROXY_URL: string; |
|
|
|
CORS_PROXY_URL: string; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export interface RuntimeConfig extends Config { |
|
|
|
|
|
|
|
BASE_PROXY_URL: string; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const env: Record<keyof Config, undefined | string> = { |
|
|
|
const env: Record<keyof Config, undefined | string> = { |
|
|
|
OMDB_API_KEY: import.meta.env.VITE_OMDB_API_KEY, |
|
|
|
OMDB_API_KEY: import.meta.env.VITE_OMDB_API_KEY, |
|
|
|
TMDB_API_KEY: import.meta.env.VITE_TMDB_API_KEY, |
|
|
|
TMDB_API_KEY: import.meta.env.VITE_TMDB_API_KEY, |
|
|
@ -38,13 +42,14 @@ function getKey(key: keyof Config): string { |
|
|
|
return value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export function conf(): Config { |
|
|
|
export function conf(): RuntimeConfig { |
|
|
|
return { |
|
|
|
return { |
|
|
|
APP_VERSION, |
|
|
|
APP_VERSION, |
|
|
|
GITHUB_LINK, |
|
|
|
GITHUB_LINK, |
|
|
|
DISCORD_LINK, |
|
|
|
DISCORD_LINK, |
|
|
|
OMDB_API_KEY: getKey("OMDB_API_KEY"), |
|
|
|
OMDB_API_KEY: getKey("OMDB_API_KEY"), |
|
|
|
TMDB_API_KEY: getKey("TMDB_API_KEY"), |
|
|
|
TMDB_API_KEY: getKey("TMDB_API_KEY"), |
|
|
|
|
|
|
|
BASE_PROXY_URL: getKey("CORS_PROXY_URL"), |
|
|
|
CORS_PROXY_URL: `${getKey("CORS_PROXY_URL")}/?destination=`, |
|
|
|
CORS_PROXY_URL: `${getKey("CORS_PROXY_URL")}/?destination=`, |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|