Hello,
This may seem like a basic question, but I’ve been having trouble understanding how to do this.
I am pretty comfortable using fetch() and GET requests on the client side, but I am kinda lost as to how to create a server URL for clients to send requests to.
const host = 'localhost';
const port = 8000;
So a local client can send network requests to http://localhost:8000, but what about remote requests? I feel like I would need to create a server URL for remote clients to use as a destination for fetch() and XMLHttpRequest() requests.
Once I deploy my server.js file to a provider, will they give me a URL that I can then assign to the host variable, and would that be enough to allow remote clients to access my server.js script using network requests?
I would super appreciate if someone could ELI5. Thank you!