미들웨어 reuse-service수정

This commit is contained in:
jsyang
2026-04-01 14:37:16 +09:00
parent c551481c5b
commit e7f4da2322
+2 -1
View File
@@ -130,7 +130,8 @@ export function middleware(req: NextRequest) {
if (pathname.startsWith("/reuse-service")) {
const queryParams = searchParams.toString();
const newUrl = `${GATEWAY_URL}${pathname}${queryParams ? `?${queryParams}` : ""}`;
const newPath = pathname.replace("/reuse-service", "");
const newUrl = `${GATEWAY_URL}/reuse-service/api/v1${newPath}${queryParams ? `?${queryParams}` : ""}`;
console.log(`[Middleware] Rewriting from '/reuse-service' path to: ${newUrl}`);
return NextResponse.rewrite(new URL(newUrl));
} else if (pathname.startsWith("/operation-service")) {