[英]React native axios call to node js backend
We're developing a react native app with a node.js server running express on the backend.我们正在开发一个反应原生应用程序,其中 node.js 服务器在后端运行 express。
We're making the call from the UI to node.js using axios.get('http://ipv4address:3001/apicall')
.我们使用
axios.get('http://ipv4address:3001/apicall')
从 UI 调用 node.js。
We've installed the expo-cli
and are trying to run the app from Expo Go on our phones.我们已经安装了
expo-cli
并尝试在我们的手机上从 Expo Go 运行该应用程序。 The LAN version works fine for the developer who has started the server and the UI, but when he changes it to Tunnel mode to share the link, we get a Promise Reject error when the axios call is made from our phones on Expo Go. The LAN version works fine for the developer who has started the server and the UI, but when he changes it to Tunnel mode to share the link, we get a Promise Reject error when the axios call is made from our phones on Expo Go.
How do you share the app with other people who are not on the same LAN?您如何与不在同一 LAN 上的其他人共享应用程序?
How do you share the app with other people who are not on the same LAN?
您如何与不在同一 LAN 上的其他人共享应用程序?
You can try expo-snack你可以试试expo-snack
Also you can import code there from git repository too.您也可以从 git 存储库中导入代码。
Click on three dots beside create folder icon to open this menu单击创建文件夹图标旁边的三个点以打开此菜单
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.