/api/proxy 미들웨어 추가

This commit is contained in:
2025-09-11 12:42:23 +09:00
parent 328787e1b2
commit 675a1a09fa
+8
View File
@@ -50,6 +50,14 @@ export function middleware(req: NextRequest) {
return rewriteWith(newUrl, req, true);
}
if (pathname.startsWith("/api/proxy")) {
const decodedQuery = toDecodedQueryString(searchParams);
const newUrl = `${SERVER_API_URL}${pathname}${decodedQuery ? `?${decodedQuery}` : ""
}`;
console.log(`[Middleware] Rewriting from '/server' path to: ${newUrl}`);
return rewriteWith(newUrl, req, true);
}
if (pathname.startsWith("/geoserver")) {
let queryParams = searchParams.toString();
const typename = searchParams.get("TYPENAME");