add a CLIENT_CONFIG to the client, serve from BE with env vars
This commit is contained in:
1 parent
ef175950b2
commit
62031a0ab1
12 files changed
+81
-7
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import type { LogLevel } from "@/Types/Log";
|
||||
|
||||
// Served by GET /config.js (rendered from server env) or a static config.js
|
||||
// next to index.html; loaded before the bundle in index.html.
|
||||
export interface RuntimeConfig {
|
||||
apiBaseUrl?: string;
|
||||
clientHost?: string;
|
||||
logLevel?: LogLevel;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__CHECKMATE_CONFIG__?: RuntimeConfig;
|
||||
}
|
||||
}
|
||||
|
||||
export const runtimeConfig: RuntimeConfig =
|
||||
(typeof window !== "undefined" && window.__CHECKMATE_CONFIG__) || {};
|
||||
Reference in new issue
Block a user