import type { NextConfig } from "next"; import { parseAllowedDevOrigins } from "./src/lib/next-dev-origins"; const apiBaseUrl = process.env.API_BASE_URL?.trim() || "http://127.0.0.1:8000"; const allowedDevOrigins = parseAllowedDevOrigins(process.env.ALLOWED_DEV_ORIGINS); const nextConfig: NextConfig = { /* config options here */ ...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}), reactCompiler: true, async rewrites() { return [ { source: "/api/:path*", destination: `${apiBaseUrl}/api/:path*`, }, ]; }, async redirects() { return [ { source: "/admin/service-desk", destination: "/admin", permanent: true, }, { source: "/admin/menu-permissions", destination: "/admin", permanent: true, }, ]; }, }; export default nextConfig;