import type { NextConfig } from "next";
import { backendInternalUrl } from "./lib/backend-internal-url";

const nextConfig: NextConfig = {
  output: "standalone",
  experimental: {
    proxyClientMaxBodySize: "512mb",
  },
  async rewrites() {
    const backendUrl = backendInternalUrl();
    return [
      { source: "/health", destination: `${backendUrl}/health` },
      { source: "/api/:path*", destination: `${backendUrl}/api/:path*` },
    ];
  },
};

export default nextConfig;
