refactor(api): simplify backend proxy to api and biz paths

This commit is contained in:
2026-07-22 17:07:05 +05:30
parent 5d3dac0b21
commit 725c256791
3 changed files with 3 additions and 6 deletions

View File

@@ -1,5 +1,2 @@
# Server-only backend origin. Do not expose this as a NEXT_PUBLIC variable.
BACKEND_ORIGIN=http://localhost:8000
# Browser requests stay on the Next.js origin and are rewritten server-side.
NEXT_PUBLIC_API_URL=/backend/

View File

@@ -11,8 +11,8 @@ const nextConfig: NextConfig = {
async rewrites() {
return [
{
source: '/backend/:path*',
destination: `${backendOrigin}/:path*`,
source: '/:namespace(api|biz)/:path*',
destination: `${backendOrigin}/:namespace/:path*`,
},
];
},

View File

@@ -1,3 +1,3 @@
export const ENV_CONSTANT = {
BASE_API_URL: process.env.NEXT_PUBLIC_API_URL,
BASE_API_URL: '/',
};