R
Railway15mo ago
druso12

Application failed to respond

Hello,I deployed a node.js application docker can run fine locally, the deploy executes correcly the deploy log is quite straight forward and I get the log Server is running on port 8080 yet the frontend says Application failed to respond https://drusotest.up.railway.app/ since I don't see any particular log and the application on docker is running fine I have no clue at what to check. I erased and redeploy everything a couple of time, but it's always the same.
6 Replies
Percy
Percy15mo ago
Project ID: 844577de-e491-4f14-ace1-d5f869c15582
druso12
druso1215mo ago
project id: 844577de-e491-4f14-ace1-d5f869c15582
jonbeau
jonbeau15mo ago
Railway should provide an environment variable port which you can use to listen on the appropriate port. (it's not visible in the UI but use it anyway)
Brody
Brody15mo ago
to expand on what Jon said, there's docs for that! https://docs.railway.app/troubleshoot/fixing-common-errors
druso12
druso1215mo ago
thank you very much, I thought it was a generic error but actually it was quite specific and could have look it up myself. I solved it by adding this to the app.js config : const port = process.env.PORT || 8080; // Starting the server and listening on port 8080 app.listen(port, () => { console.log(Server is running on port ${port}); }); thank you very much for your support.
jonbeau
jonbeau15mo ago
No problem 👍🙂
Want results from more Discord servers?
Add your server