Files
IB/next.config.mjs

55 lines
1.2 KiB
JavaScript

/** @type {import('next').NextConfig} */
import os from "os";
const isWindows = os.platform() === "win32";
// Security headers
const securityHeaders = [
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "X-Frame-Options",
value: "DENY",
},
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
];
const nextConfig = {
// Hide "X-Powered-By: Next.js"
poweredByHeader: false,
experimental: {
serverComponentsExternalPackages: ["typeorm", "knex"],
},
reactStrictMode: true,
async rewrites() {
return [
{
source: "/api/:path*",
destination: isWindows
? "http://localhost:8080/api/:path*" // For Windows
: "http://localhost:8080/api/:path*", // For Linux/Mac/Server
},
];
},
async headers() {
return [
{
source: "/(.*)", // Apply to all routes
headers: securityHeaders,
},
];
},
};
export default nextConfig;