Commit Graph

5 Commits

Author SHA1 Message Date
MarkLo127 b8454fefc7 Replace next.config.ts rewrites with catch-all API proxy route
The rewrites() approach resolves the backend URL once at server startup,
which always falls back to http://backend:8000 on Railway (where that
Docker Compose hostname doesn't exist). This caused ECONNREFUSED for
/api/analyze and all other proxied routes.

Fix: Add app/api/[...path]/route.ts that resolves the backend URL
per-request via getBackendUrl(), matching the pattern already used by
/api/chat and /api/auth/google/token routes.

Changes:
- New: frontend/app/api/[...path]/route.ts — catch-all proxy (GET/POST/PUT/PATCH/DELETE)
- Removed: frontend/app/api/chat/route.ts — now handled by catch-all
- Updated: frontend/next.config.ts — removed rewrites() block
- Updated: frontend/Dockerfile — cleared NEXT_PUBLIC_API_URL build default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 11:37:12 +08:00
MarkLo 06bf068875 2025-12-23 10:32:58 +08:00
MarkLo e896968aa8 2025-11-21 22:52:52 +08:00
MarkLo c769c971a7 2025-11-21 09:22:14 +08:00
MarkLo 2872f18b47 2025-11-20 21:56:47 +08:00