I want to fetch data from a different Server with a REST API.
I do this:
return fetch('http://localhost:9000/processes')
.then((response) => response.json())
.then((responseJson) => {
return responseJson;
})
.catch((error) => {
console.error(error);
});
In the render function I have this:
{JSON.stringify(getProcesses().Prozess1) }
and this
{JSON.stringify(getProcesses()) }
no one of thesse two examples returns something
The rest API should return this:
{
"Prozess1": "Hallo ich bin ein Prozess"
}
whats my problem in this case
getProcesses()is that asynchronous action which returns a promise?