/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
// matching all API routes
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" }, // replace this your actual origin
{ key: "Access-Control-Allow-Methods", value: "GET,DELETE,PATCH,POST,PUT" },
{ 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" },
]
}
]
}
}
module.exports = nextConfig
Last active
October 28, 2023 12:16
-
-
Save TuenTuenna/cd96f76f5f9d6206ac169e81354fdbd7 to your computer and use it in GitHub Desktop.
next.config.js 파일 -> cors 세팅
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment