adrianhajdin / project_ai_mern_image_generation

Build and Deploy a Full Stack MERN AI Image Generation App MidJourney & DALL E Clone
https://jsmastery.pro
1.08k stars 302 forks source link

CORS Error #55

Closed soumizde closed 1 year ago

soumizde commented 1 year ago

Screenshot (92)

As soon as I am inputting const response = await fetch("https://dalle-arbb.onrender.com/api/v1/post", { method: 'GET', headers: { 'Content-Type': 'application/json', }, }); I am getting a CORS error. How do I fix this?

adnan179 commented 1 year ago

use the url "http://localhost:8080/api/v1/post" as it is the url u are using to fetch data as of now, which is from the server

soumizde commented 1 year ago

I tried that and I even tried removing the http://localhost:8080 which may sometimes resolve the error. Now I am not getting a CORS error however I still cannot fetch the data