0
I’m developing an app in React Native, using the expo.
I have a Node.js API running on my Macbook. Both my phone and laptop are under the same Wifi network.
In the app, I have an API call pointing to the IP of my machine + port where the server is running:
import axios from 'axios';
const api = axios.create({
baseURL: 'http://<IP da máquina>:3333'
});
export default api;
The API call is made in:
const response = await api.get('resource')
however, when I start the application, the data that should come from my Node.js server is not loaded.
Trying to access the same endpoint in the mobile browser, I get error:
ERR_ADDRESS_UNREACHABLE
I have tried several ways to solve the problem: - I disabled the Machine Firewall - I checked that the router configuration 'Isolation ap' was enabled, and was not. - among other things.
This answers your question? Problem when performing HTTP request on Android
– Rafael Tavares