var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });

// src/auth/middlewares/proxy.ts
import { NextResponse } from "next/server";
function proxyMiddleware(request) {
  const { pathname, search } = request.nextUrl;
  const apiUrl = process.env.NEXT_PUBLIC_API_URL;
  if (pathname.startsWith("/media/")) {
    const targetUrl = `${apiUrl}${pathname}${search}`;
    return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });
  }
  if (pathname.startsWith("/api/")) {
    const targetUrl = `${apiUrl}${pathname}${search}`;
    return NextResponse.rewrite(targetUrl, { request: { headers: request.headers } });
  }
  return NextResponse.next();
}
__name(proxyMiddleware, "proxyMiddleware");
var proxyMiddlewareConfig = {
  matcher: ["/media/:path*", "/api/:path*"]
};
export {
  proxyMiddleware,
  proxyMiddlewareConfig
};
//# sourceMappingURL=auth-server.mjs.map