简体   繁体   English

将本机 axios 调用反应到节点 js 后端

[英]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.

相关问题 来自 React Native axios 调用 Node.js 的网络错误 - Network Error from React Native axios call to Node.js 使用 Axios 在具有 Node.js 后端的 React Native 应用程序中获取请求的网络错误 - Network error using Axios get request in React Native app having Node.js backend 如何在 Android 设备上运行带有 Node js 后端的 React Native 应用程序? - How to run a React Native App with Node js Backend on Android Device? 如何将值从反应本机应用程序传递到节点 js 后端 - How to pass value from a react native app to a node js backend 如何在 react js 中使用 axios 同时将数据和照片发送到节点 js 后端 - How to send data and photo at same time to node js backend using axios in react js 从 React.js 到节点后端的 Rest 调用错误 - Rest call error from React.js to node backend 如何将我从 axios 获得的这些数据传递到使用 node.js(react 和 node.js)的后端 - How do I pass this data i get from axios to the backend which uses node.js (react & node.js) React Native-不变违规:对象作为React Child无效(使用Node JS作为后端) - React Native - Invariant Violation: Objects are not valid as a React Child (Using Node JS for backend) 使用 axios 从 mysql db.React 作为前端删除行,node.js 和 express.js 作为后端 - Using axios to delete the row from mysql db.React as front end with node.js and express.js as backend 用于后端的节点JS Express和用于前端的React JS - Node JS Express for backend and React JS for frontend
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM