/** * Trouve-KA — configuration Next.js (rewrites API vers le backend FastAPI) * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai */ /** * Le client fetch toujours des chemins relatifs `/api/...` : Next.js proxifie * vers le backend (API_URL). Ainsi tout fonctionne à l'identique en local et * derrière le tunnel ngrok (www.trouve-ka.com), sans URL absolues côté client. */ const API_URL = process.env.API_URL || "http://localhost:8080"; /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, poweredByHeader: false, async rewrites() { return [ { source: "/api/:path*", destination: `${API_URL}/api/:path*`, }, ]; }, }; export default nextConfig;