I created an api with spring boot and it's running on http://localhost:8080 but when trying to fetch data from it in react (running on localhost:5173) I'm getting this error :
"localhost/:1 Access to fetch at 'http://localhost:8080/api/songs' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled."
I tried adding http://locahost:8080 as a "proxy" in my package.json file but it still didn't work
I tried adding http://locahost:8080 as a "proxy" in my package.json file but it still didn't work