Skip to content

Commit 47296f0

Browse files
committed
update next.config.js
1 parent d6e5ea6 commit 47296f0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

next.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ const nextConfig = {
44
return [
55
{
66
// matching all API routes
7-
source: '/:path*',
7+
source: '/api/:path*',
8+
headers: [
9+
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
10+
{ key: 'Access-Control-Allow-Origin', value: '*' },
11+
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' },
12+
{ 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, Authorization' },
13+
],
14+
},
15+
{
16+
// matching all API routes
17+
source: 'api/blog/:path*',
818
headers: [
919
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
1020
{ key: 'Access-Control-Allow-Origin', value: '*' },

0 commit comments

Comments
 (0)