Merge pull request 'chore: Refactor next.config.ts to streamline API rewrites and remove unnecessary CORS headers' (#4) from feature/chore into dev
Reviewed-on: #4
This commit is contained in:
commit
17641d2b57
@ -7,31 +7,10 @@ const nextConfig: NextConfig = {
|
|||||||
includePaths: [path.join(__dirname, './src/styles')],
|
includePaths: [path.join(__dirname, './src/styles')],
|
||||||
},
|
},
|
||||||
async rewrites() {
|
async rewrites() {
|
||||||
return [
|
|
||||||
{
|
|
||||||
source: '/:path*',
|
|
||||||
destination: `${process.env.NEXT_PUBLIC_API_URL}/:path*`,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
async headers() {
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
source: '/api/:path*',
|
source: '/api/:path*',
|
||||||
headers: [
|
destination: `${process.env.NEXT_PUBLIC_API_URL}/api/:path*`,
|
||||||
{
|
|
||||||
key: 'Access-Control-Allow-Origin',
|
|
||||||
value: '*',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'Access-Control-Allow-Methods',
|
|
||||||
value: 'GET, POST, PUT, DELETE, OPTIONS',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'Access-Control-Allow-Headers',
|
|
||||||
value: 'Content-Type, Authorization',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user