How to connect to backend server running on my desktop only

#1

I am new to CRNA, I just follow the instructions to create a new app. Now I am adding a function to retrieve data from a rest endpoint running written by nodejs running on my desktop only. the url is localhost:8080. As expo is on my phone, is their any standard way to access the rest end point url from my phone?

#2

Two things you could do:

  1. Run your server in a way that’s accessible beyond localhost. Run it on 0.0.0.0 instead of localhost and make sure that port 8080 is not blocked by your firewall. And then make sure your phone and computer are on the same wifi network / LAN.

  2. Use ngrok or something similar to create a world accessible.

1 Like
#3

Tried ngrok, awesome tool. thanks for your reply.

1 Like