Exported Route for CORS usage

This commit is contained in:
Joao Ramos
2024-01-11 00:06:09 +00:00
parent 174398b4f7
commit 93d5015c99
2 changed files with 27 additions and 7 deletions

View File

@@ -1,7 +1,27 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
output: "standalone",
reactStrictMode: true,
output: "standalone",
async headers() {
return [
{
source: "/api/packages",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "false" },
{ key: "Access-Control-Allow-Origin", value: "http://localhost:3000" },
{
key: "Access-Control-Allow-Methods",
value: "GET",
},
{
key: "Access-Control-Allow-Headers",
value:
"Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date",
},
],
},
];
},
};
module.exports = nextConfig;