mirror of
https://github.com/sortedcord/omnia.git
synced 2026-07-22 03:52:48 +05:30
feat: Added primitive scenario-builder
This commit is contained in:
33
content/scenario-builder/next.config.ts
Normal file
33
content/scenario-builder/next.config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { NextConfig } from "next";
|
||||
import { networkInterfaces } from "os";
|
||||
|
||||
const getLocalIPs = () => {
|
||||
const ips: string[] = ["localhost", "127.0.0.1"];
|
||||
const nets = networkInterfaces();
|
||||
for (const name of Object.keys(nets)) {
|
||||
for (const net of nets[name] || []) {
|
||||
if (net.family === "IPv4" && !net.internal) {
|
||||
ips.push(net.address);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ips;
|
||||
};
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
allowedDevOrigins: getLocalIPs(),
|
||||
async headers() {
|
||||
return [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
headers: [
|
||||
{ key: "Access-Control-Allow-Origin", value: "*" },
|
||||
{ key: "Access-Control-Allow-Methods", value: "GET,POST,PUT,DELETE,OPTIONS" },
|
||||
{ key: "Access-Control-Allow-Headers", value: "Content-Type, Authorization" },
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
Reference in New Issue
Block a user