diff --git a/frontend/src/utils/api-base.ts b/frontend/src/utils/api-base.ts index 5e3908c8..2e358d61 100644 --- a/frontend/src/utils/api-base.ts +++ b/frontend/src/utils/api-base.ts @@ -1,5 +1,9 @@ export function getApiBaseUrl(): string { - // Use same-origin requests by default. - // In local Vite dev, `vite.config.ts` proxies `/api` to the Go backend. - return ''; + // LocalHub plugin patch (2026-04-29): respect vite's BASE_URL so that + // axios calls work at `/app/weknora/` (LocalHub reverse proxy). Without + // this · axios hits `/api/v1/...` at LocalHub root · gets 404 "Cannot + // POST". Strip trailing slash so axios doesn't produce `/app/weknora//api/v1/...`. + // See: plugins/weknora/patches/api-base-baseurl.patch + const base = (import.meta.env.BASE_URL || '/').replace(/\/+$/, ''); + return base; }