1import type { NextConfig } from "next";23const apiUrl = process.env.API_URL ?? "http://127.0.0.1:8221";45const nextConfig: NextConfig = {6 reactStrictMode: true,7 agentRules: false,8 poweredByHeader: false,9 transpilePackages: ["@fetcha/core", "@fetcha/db", "@fetcha/email", "@fetcha/providers"],10 serverExternalPackages: ["pg", "undici", "resend"],11 async rewrites() {12 // Public API is served on the same domain under /v1/* and forwarded to the Fastify service.13 return [14 { source: "/v1/:path*", destination: `${apiUrl}/v1/:path*` },15 { source: "/api/health", destination: `${apiUrl}/health` },16 { source: "/api/ready", destination: `${apiUrl}/ready` },17 ];18 },19 async headers() {20 return [21 {22 source: "/(.*)",23 headers: [24 { key: "X-Content-Type-Options", value: "nosniff" },25 { key: "X-Frame-Options", value: "DENY" },26 { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },27 { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },28 ],29 },30 ];31 },32};3334export default nextConfig;35