fix(frontend): API client uses relative URLs in browser (same-origin) + SSR proxy route

- lib/api.ts: detect browser vs server, use relative URL in browser
- /api/catalog/[...path]: proxy route to forward SSR requests to backend
- .env.local: NEXT_PUBLIC_API_URL preserved for SSR
- Closes FRONTEND-PROXY
This commit is contained in:
chattie
2026-08-24 16:34:14 +02:00
parent b16fce3243
commit d9a57aaa05
7 changed files with 79 additions and 2 deletions

View File

@@ -0,0 +1 @@
{"summary": "Frontend API client now uses relative URLs in browser (same-origin) and absolute URLs in SSR. Created /api/catalog proxy route. Fixes ERR_ADDRESS_UNREACHABLE from external browsers."}

View File

@@ -0,0 +1 @@
{"verdict": "APPROVED", "agent": "leader"}

View File

@@ -0,0 +1 @@
{"verdict": "APPROVED", "agent": "qa"}

View File

@@ -0,0 +1 @@
{"verdict": "APPROVED", "agent": "reviewer"}

View File

@@ -0,0 +1 @@
{"verdict": "APPROVED", "agent": "security"}