aethex-forge/client/lib/api-base.ts
Builder.io 1ef0cc707b Create API base URL utility for all client code
cgen-188cac9c01b24a52894ae0eae6b12663
2025-11-16 10:19:31 +00:00

11 lines
327 B
TypeScript

/**
* 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;
}