/** @type {import('next').NextConfig} */
const nextConfig = {
  output: 'standalone',
  experimental: {
    serverActions: {
      bodySizeLimit: '100gb',
    },
  },
  async rewrites() {
    return [
      {
        source: '/api/:path*',
        destination: `${process.env.API_URL || 'http://backend:5827'}/api/:path*`,
      },
      {
        source: '/health',
        destination: `${process.env.API_URL || 'http://backend:5827'}/health`,
      },
    ];
  },
};

module.exports = nextConfig;
