Next.js Discord

Discord Forum

Setup CORS for fetch endpoings

Unanswered
Silver carp posted this in #help-forum
Open in Discord
Silver carpOP
Trying to fetch resources from a CDN and dunno how to setup CORs for this use case.

I see these docs: https://nextjs.org/docs/app/building-your-application/routing/middleware#cors

I can make calls to /api/* and the middleware kicks in. However, not sure how to actually continue the call to the CDN.

2 Replies

Brown bear
how to disable cors in nextjs api @kapa
Brown bear
how to disable cors in nextjs api @Silver Marten