Calling locally hosted server from Expo App

后端 未结 7 724
无人共我
无人共我 2020-12-08 20:26

I am creating a react-native app and one of the components I have created contains a property which is populated through data coming from an http request.

Right now

相关标签:
7条回答
  • 2020-12-08 21:09

    One another easy way. First you need to on Mobile HotSpot and connect to laptop using Mobile HotSpot. Then check you ip assign to your computer and replace api url http://localhost:80/ address to http://192.168.5.43:80/ in react-native source where you use.

    Replace port 80 to your api server port no.

    Make sure you have open server port (80) in firewall in laptop.

    Test api in android rest-client https://play.google.com/store/apps/details?id=com.sn.restandroid app (url : http://192.168.5.43:80/api)

    0 讨论(0)
提交回复
热议问题