I have a Spring Boot application running on the backend on localhost:8080. The front end is react app on localhost:3000. I'm trying to call a url from the backend but result is empty. Why?
If I call the backend url directly in a browser like this:
I see the data come in ok (in the form of a view template) that looks like this:
But when I call the same url from my react app like this:
useEffect(() => {
(
async () => {
const result = await axios("http://localhost:8080/appointments");
console.log("result="+result);
//setData(result.data);
}
)();
},
then the console shows and empty result:
result=[object Object]
Sorry if this is a basic question. I'm new to react.