Fix: Append :path* to FASTAPI_URL in rewrites
The rewrite destination was using FASTAPI_URL directly, which replaced the entire destination including the :path* parameter. This caused /api/compare to rewrite to just http://backend:80/api instead of http://backend:80/api/compare. Now properly constructs: ${FASTAPI_URL}/:path* Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,10 +5,11 @@ const nextConfig = {
|
|||||||
|
|
||||||
// API Proxy to FastAPI backend
|
// API Proxy to FastAPI backend
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
|
const apiUrl = process.env.FASTAPI_URL || 'http://localhost:8000/api';
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/api/:path*',
|
source: '/api/:path*',
|
||||||
destination: process.env.FASTAPI_URL || 'http://localhost:8000/api/:path*',
|
destination: `${apiUrl}/:path*`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user