/** @type {import('next').NextConfig} */
const API_BASE = process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000"

const nextConfig = {
  typescript: {
    ignoreBuildErrors: true,
  },
  images: {
    unoptimized: true,
  },
  async rewrites() {
    return [
      {
        source: "/api/v1/waitlist/:path*",
        destination: `${API_BASE}/api/v1/waitlist/:path*`,
      },
      {
        source: "/api/v1/waitlist",
        destination: `${API_BASE}/api/v1/waitlist`,
      },
      {
        source: "/docs/:path*",
        destination: `${API_BASE}/docs/:path*`,
      },
      {
        source: "/openapi.json",
        destination: `${API_BASE}/openapi.json`,
      },
    ]
  },
}

export default nextConfig
