0

I'm running a local express server at Port 5000. However, when I fetch http://localhost:5000/api from my react webapp (XAMPP), the server does not respond. How would I self host my express app to make it accessible from anywhere, not just during development.

Gandy
  • 23
  • 1
  • 4

1 Answers1

0

Ideally, if your express server is running on port 5000 then it should be accessible by localhost:5000 or 127.0.0.1:5000. Try looking at your console logs in your browser for details(provide more information). Another thing to look out for is to check if it's running on http or https in production.

By default the server will run on all interfaces, not just localhost, so you can access it remotely by using its IP address on that network. (see https://stackoverflow.com/a/33957043/9726680)

silentPlanet
  • 341
  • 2
  • 9