/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  // output: 'standalone', // Only needed for Docker deployment
  
  // Proxy API requests to backend
  // This ensures /api/v1/* works regardless of how the server is accessed
  async rewrites() {
    // Determine backend URL based on environment
    const backendUrl = process.env.BACKEND_URL || 'http://127.0.0.1:8000'
    
    return [
      {
        source: '/api/v1/:path*',
        destination: `${backendUrl}/api/v1/:path*`,
      },
    ]
  },
}

module.exports = nextConfig

