Cors issue with fetching data

Hello, I am trying to fetch some data from my local API but I have some issues with cors, can anyone help me?

Screenshot_4

useEffect(()=>{
fetch("http://localhost:3001/api").then(res=>res.json()).then(res=>console.log(res))
  },[])

UPDATE:
I solved this issue in the meanwhile by installing 'cors' package in my node app and using app.use(cors())

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.