Events: everything the backend serves is under /api (for 2.3.0)

The site and its API can share one address with one proxy rule (/api to
the backend, everything else to the frontend). Status page at /api (/
redirects), /api/health, /api/docs/v2, /api/uploads. Stored upload
paths stay /uploads/… and are given out as /api/uploads/…. Old paths
still answer (/health, /uploads) or redirect (/docs, /docs/v2), so
two-address sites keep working. DEPLOYMENT.md and the agent plan
describe the single rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 11:11:46 +02:00
co-authored by Claude Opus 5.5
parent e8853cf0c8
commit afaccf79d1
14 changed files with 107 additions and 37 deletions
+4 -1
View File
@@ -72,7 +72,10 @@ export function resolveToApiOrigin(urlOrPath: string | null | undefined): string
} catch {
// fall through to relative handling
}
return API_BASE ? `${API_BASE}${raw}` : raw;
// Stored uploads ("/uploads/…") are served under /api/uploads (2.3.0), so they reach the
// backend when the site and its API share one address.
const path = raw.startsWith("/uploads/") ? `/api${raw}` : raw;
return API_BASE ? `${API_BASE}${path}` : path;
}
// The parsed JSON body of a failed request — v1 sends `message` (some routes add a