chore: Refactor next.config.ts to streamline API rewrites and remove unnecessary CORS headers

This commit is contained in:
yoosangwook 2025-04-30 15:01:23 +09:00
parent 01e41fd1f5
commit 45b244d309

View File

@ -7,31 +7,10 @@ const nextConfig: NextConfig = {
includePaths: [path.join(__dirname, './src/styles')],
},
async rewrites() {
return [
{
source: '/:path*',
destination: `${process.env.NEXT_PUBLIC_API_URL}/:path*`,
},
]
},
async headers() {
return [
{
source: '/api/:path*',
headers: [
{
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',
},
],
destination: `${process.env.NEXT_PUBLIC_API_URL}/api/:path*`,
},
]
},