Next.js Discord

Discord Forum

405 CORS error on website online (Vercel)

Highlander posted this in #help-forum
Open in Discord
My app is a React app using Express and Node JS server to call MongoDB online database. I host on Vercel. There is no problems except I cannot fetch any queries. I checked my express configuration, my next.config, I even added vercel.json with the cors configs.
my server config is :
const corsOptions = {
origin: '',
and my fetch query is using the url : const url = .
My code works in localhost but not on live version.

My API call is like'/', async (req, res) => { code here...})

I was wondering what's the issue?

0 Replies