Skip to content

Commit 5697e55

Browse files
committed
fix CORS error on mock API byrewrite on versel
1 parent 1c49c52 commit 5697e55

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

next.config.mjs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,10 @@ const nextConfig = {
88
return [
99
{
1010
// matching all API routes
11+
1112
source: '/api/:path*',
12-
destination: 'https://ssl-chat.vercel.app/:path*',
13-
headers: [
14-
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
15-
{ key: 'Access-Control-Allow-Origin', value: '*' },
16-
{
17-
key: 'Access-Control-Allow-Methods',
18-
value: 'GET,DELETE,PATCH,POST,PUT',
19-
},
20-
{
21-
key: 'Access-Control-Allow-Headers',
22-
value:
23-
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version',
24-
},
25-
],
13+
destination: 'https://ssl-chat.vercel.app/api/:path*',
14+
2615
},
2716
];
2817
},

0 commit comments

Comments
 (0)