Application Not working
It's my first time using railway, and I followed a video, but mine is not working, I followed the exact steps. In the deploy logs I see my messages for successfull connections to server and database (server connected and database connected). But when I access the genereated link, I get "Application failed to respond". What might be the cause of the problem?
19 Replies
Project ID:
6f38d8e1-4d25-4b98-92ad-bbd35b159999
6f38d8e1-4d25-4b98-92ad-bbd35b159999
This is provided as the solution for this problem.. But my question is, if I update my code with
app.listen(port, "0.0.0.0" ... )
shouldn't it automatically start on the port variable defined earlier?shouldn't it automatically start on the port variable defined earlier?What do you mean by this?
proccess.env.PORT
that's how you access env variables
When defining the port variable, we give it 2 choices right? a number.. 5000 in my case, or process.env.PORT which is an env variable, since they are predefined, the app will always use them, instead of "0.0.0.0"
0.0.0.0 is the host
the port is seperate from that.
i just do this lmao
0.0.0.0 is the ip adress, and the port is something completely unrelated
ohh π
ye, dw
A little dumb of me, but it's working now.. I looked closely and it was a matter of preference
perfect then
The docs say I should prioritize the env variable
And not the hard coded port number
yeah
It's working now! Thanks for all the time and help!!
npnp
gl with your app