How to access second node application on same server?

Hi there! Sorry if this was asked already; I searched for quite some time, but did not manage to find a solution to my issue.

In a nutshell I’m trying to send http request from my one nodejs application to the other, both residing on the same digitalocean server. (localhost:8080 and localhost:3000) Only localhost 8080 is meant to be accessed from the outside, 3000 is an API that could remain local to the server.

However when executing those queries, they are not received.

I might be off with my understanding, but the same setup up is working on my local machine, shouldn’t that be true for the server as well? Is there a reason why you would not be able to access a second nodejs app locally?

I’m a weird engineer doing programming, so please have mercy with my soul and I would appreciate any help especially if it includes some explanations about network fundamentals.

Thank you so much already!


EDIT: I just read up on curl and checked via the terminal that I indeed can access the endpoint that I expose locally. Some endpoint however coming from the axios request from my react frontend does not work, are there any headers maybe I need to set for my request in this different environment?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.