I'm building a React Native app with Expo, I'm trying to fetch my back-end server like this:
useEffect(() => {
fetch('http://192.168.1.89:8080/api/ciborg/groups')
.then((response) => response.json())
.then((json) => setData(json))
.catch((error) => console.log("->>>>"+error))
.finally(() => setLoading(false));
});
But is always gives me the following error
"TypeError: Failed to fetch".
I have already tried the following:
fetch('http://192.168.1.89:8080/api/ciborg/groups')
fetch('http://localhost:8080/api/ciborg/groups')
fetch('http://127.0.0.1:8080/api/ciborg/groups')
But it's always the same result. However fetching outside APIs like: https://reactnative.dev/movies.json works.
Can anyone help?
8080?