I'm trying to make my node application working on heroku, and i stumble upon a, i'm sure common problem, but, i can't sort it out.
my project is a 3 part system, composed of :
on my computer everything runs fine, since everybody listen to the node server from the same ip/port. but in herku since the port is dynamic, i can't get the two other components to know where to connect to.
i define my port like this :
var port = process.env.PORT || 5000;
and log the port on server up via a console.log statement.
after checking my logs a few time, and then looked at the heroku doc, i realised that i can't have a static port on heroku.
So i'm kind of lost on how can i get the two other component to get heroku port.
side note : here are the solution i will try to implement if i can't get it to work
thanks for the time you spent reading my existentials problems, and thanks in advance for the help
To connect external apps to a heroku app you don't need to know the port. Since the app is accessible through a domain name you may simple connect to that one (eg app_name.herokuapps.com, or get your own domain if you prefer).