Files
FitOS/app/src/config.ts
2026-09-04 19:06:19 +02:00

16 lines
422 B
TypeScript

/// <reference types="vite/client" />
declare global {
interface Window {
__FITOS_CONFIG__?: { apiUrl?: string };
}
}
// Runtime config (config.js) takes precedence, then build-time VITE_API_URL, then same origin.
export const API_URL: string =
window.__FITOS_CONFIG__?.apiUrl ||
(import.meta.env.VITE_API_URL as string | undefined) ||
window.location.origin;
export const API_BASE = `${API_URL}/api/v1`;