Node server error but deployment worked
Hey, I'm learning a bit about web sockets and followed a tutorial and I wanted to deploy it to test how easy deploying would be as I want to build a proper app in future.
Locally, it works fine running
node server.js
, but when I deployed it to railway, it errors when I go to the URL created with "Application failed to respond".
In the deployment logs, it shows as successful and I am not sure what I have done wrong:
I'm not really sure what to look for to find out what is wrong.Solution:Jump to solution
You need to listen on the port that railway provides
https://docs.railway.app/guides/fixing-common-errors
in your case
```js...
4 Replies
Project ID:
1c3e4a4f-c6fe-4419-bb90-a9fda1ff6517
1c3e4a4f-c6fe-4419-bb90-a9fda1ff6517
Solution
You need to listen on the port that railway provides
https://docs.railway.app/guides/fixing-common-errors
in your case
this will listen on the port railway provides and if that port is not given, it'll default to
8080
I will give that a try, thank you!
That was it, thank you!