Skip to content

Commit

Permalink
feat: add CORS headers configuration for API routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafacv23 committed Feb 1, 2025
1 parent 417e716 commit 2088029
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
async headers() {
return [
{
source: "/api/:path*",
headers: [
{
key: "Access-Control-Allow-Credentials",
value: "true",
},
{
key: "Access-Control-Allow-Origin",
value: "https://f1api.dev",
},
{
key: "Access-Control-Allow-Methods",
value: "GET",
},
{
key: "Access-Control-Allow-Headers",
value: "Content-Type, Authorization",
},
],
},
]
},
}

export default nextConfig;
export default nextConfig

0 comments on commit 2088029

Please sign in to comment.