Can't seem to fetch the info from the data base on the deployed site

30 Views Asked by At

So I've just finished an app and I'm trying to put it online for the first time by myself. Everything works fine while on localhost but with the deployed version in vercel it doesn't get the info from the data base and I get this error:

Access to XMLHttpRequest at 'https://tiagoratocv.cyclic.app/api/experience' from origin 'https://tiagorato.vercel.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I've looked into other posts and haven't found an answer to my issue in the languages I know and understand. I've added to the code the links to the back and front end (ex:

  app.use(
    cors({
      origin: [FRONTEND_URL, "https://tiagorato.vercel.app"],
    })
  );

) but still to no effect. Does anyone know what the issue might be and how to fix it? Thanks in advance

0

There are 0 best solutions below