Files
ERP-core/Frontend/erp-system/next.config.ts
T
Dhananjaya99 fdd104284e feat: add ItemOverviewDto for enriched item data in items list
feat: implement CustomerDetailPage for detailed customer view and editing

feat: create CustomersPage for listing and managing customers with filters

feat: add ColumnsMenu component for customizable table columns visibility

feat: implement CSV export functionality for data download

feat: add customer code generation logic for unique customer identifiers
2026-09-22 00:32:40 +05:30

32 lines
1.1 KiB
TypeScript

import type { NextConfig } from "next"
import path from "path"
// The backend is proxied rather than called cross-origin. This makes /api/* same-origin,
// which means (a) no CORS config is needed on ERPCore, and (b) its Secure/SameSite=Strict
// session cookies just work. BACKEND_ORIGIN is server-side only — deliberately not
// NEXT_PUBLIC_*, since the browser only ever talks to this Next server.
//
// Defaults to the backend's HTTP port: the HTTPS port uses a self-signed dev cert that
// this proxy would reject.
//
// Uses 127.0.0.1, not "localhost": Node resolves "localhost" to the IPv6 loopback (::1)
// first on this machine, but Kestrel only binds the IPv4 wildcard (0.0.0.0), so every
// proxied request failed with ECONNREFUSED ::1:6701 until this was pinned to IPv4.
const BACKEND_ORIGIN = process.env.BACKEND_ORIGIN ?? "http://127.0.0.1:6701"
const nextConfig: NextConfig = {
turbopack: {
root: path.join(__dirname),
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${BACKEND_ORIGIN}/api/:path*`,
},
]
},
}
export default nextConfig