/api/proxy 미들웨어 추가
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user