
[Next.js - v14] 외부 API 요청시 CORS 에러 대응
·
nextjs
CORS 란CORS는 Cross-Origin Resource Sharing의 줄임말로 교차-출처 리소스 공유하고도 한다.즉, 다른 출처라고도 말할 수 있고 다른 출처이기 때문에 발생하는 에러라고도 할 수 있다. next.config.mjs 설정** next.config.mjs **/** @type {import('next').NextConfig} */const nextConfig = { reactStrictMode: true, swcMinify: true, async rewrites() { return [ { source: '/api/:path*', destination: 'http://apis.data..