next.config.ts 351 B

123456789101112131415
  1. import type { NextConfig } from "next";
  2. const nextConfig: NextConfig = {
  3. async rewrites() {
  4. const apiOrigin = process.env.INTERNAL_API_BASE_URL?.replace(/\/$/, "") ?? "http://127.0.0.1:3001";
  5. return [
  6. {
  7. source: "/api/:path*",
  8. destination: `${apiOrigin}/api/:path*`,
  9. },
  10. ];
  11. },
  12. };
  13. export default nextConfig;