Skip to content

Commit

Permalink
chore: CORS 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
qkrdmstlr3 committed Aug 26, 2024
1 parent 5917a34 commit fa522ed
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
async headers() {
return [
{
// matching all API routes
source: '/api/v1/:path*',
headers: [
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,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',
},
],
},
];
},
};

export default nextConfig;

0 comments on commit fa522ed

Please sign in to comment.