Files
pepperplus-ui/src/config/api.ts
Twirre Meulenbelt 4395e44dbf feat: introduce backend url environment variable
ref: N25B-352
2026-01-29 17:40:49 +01:00

12 lines
354 B
TypeScript

declare const __VITE_API_BASE_URL__: string | undefined;
const DEFAULT_API_BASE_URL = "http://localhost:8000";
const rawApiBaseUrl =
(typeof __VITE_API_BASE_URL__ !== "undefined" ? __VITE_API_BASE_URL__ : undefined) ??
DEFAULT_API_BASE_URL;
export const API_BASE_URL = rawApiBaseUrl.endsWith("/")
? rawApiBaseUrl.slice(0, -1)
: rawApiBaseUrl;