All of the requests are for absolute paths. So for the ping example would just be:
Then node works out to send it to the right place. This maps the create react app on port 3000 to the api requests on 8080.
If you want them on a separate server you'll need to call with the port number, or domain that you setup your api server on.
With that option, however you'll neeed to fiddle with your API access control. So that you only allow access to your app, not the whole internet. However, this can be more tricky and fiddly and depends a lot on how you setup your architecture.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.