Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

feat(frontend): respect BASE_URL so the SPA works behind a path-prefix reverse proxy

toy011605d35c904bb2
diff --git a/frontend/src/utils/api-base.ts b/frontend/src/utils/api-base.ts
index 5e3908c8b..2e358d612 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;
}