Skip to content

Commit

Permalink
Merge pull request #102 from Matergi/fix-cors
Browse files Browse the repository at this point in the history
fix(general): fixed cors
  • Loading branch information
Matergi committed May 8, 2024
2 parents 7df7967 + e5e4d56 commit a941343
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,26 @@ export default withSentryConfig(
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,

async headers() {
return [
{
source: "/api/:path*", // matching all API routes
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{
key: "Access-Control-Allow-Methods",
value: "GET,DELETE,PATCH,POST,PUT",
},
{
key: "Access-Control-Allow-Headers",
value:
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
},
],
},
]
},
}
)

0 comments on commit a941343

Please sign in to comment.