Krishang
Krishang
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
It's working now! Thanks for all the time and help!!
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
And not the hard coded port number
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
The docs say I should prioritize the env variable
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
A little dumb of me, but it's working now.. I looked closely and it was a matter of preference
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
ohh 😅
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
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"
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
// Use PORT provided in environment or default to 3000
const port = process.env.PORT || 3000;

// Listen on `port` and 0.0.0.0
app.listen(port, "0.0.0.0", function () {
// ...
});
// Use PORT provided in environment or default to 3000
const port = process.env.PORT || 3000;

// Listen on `port` and 0.0.0.0
app.listen(port, "0.0.0.0", function () {
// ...
});
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?
26 replies
RRailway
Created by Krishang on 6/4/2023 in #✋|help
Application Not working
6f38d8e1-4d25-4b98-92ad-bbd35b159999
26 replies