diff --git a/client/lib/api-base.ts b/client/lib/api-base.ts new file mode 100644 index 00000000..340063d6 --- /dev/null +++ b/client/lib/api-base.ts @@ -0,0 +1,11 @@ +/** + * Get the API base URL + * Always uses window.location.origin since the API is served from the same origin + * This works for both development (localhost:8080) and production (aethex.dev) + */ +export function getApiBase(): string { + if (typeof window === "undefined") { + return ""; + } + return window.location.origin; +}