diff --git a/src/lib/api.ts b/src/lib/api.ts index a44abf5..d4363de 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,4 +1,8 @@ -const BASE = import.meta.env.VITE_API_URL ?? 'https://odoo-mcp.thedomainnest.com'; +// Strip any trailing slash regardless of how VITE_API_URL was set — every +// call site below concatenates a leading-slash path directly onto BASE +// (e.g. `${BASE}/api/signup`), so a trailing slash here would silently +// produce a double-slash URL that 404s. +const BASE = (import.meta.env.VITE_API_URL ?? 'https://api.getodoomcp.com').replace(/\/+$/, ''); // FastAPI's `detail` field is a plain string for handler-raised HTTPExceptions, // but an array of {loc, msg, type} objects for its own automatic request