Node JS application: deployment is succesfull but server error(application failed to respond)
Cloud please tell me the reason
I have attached snap also FYI
![No description](https://cdn.answeroverflow.com/1218124934828523630/Screenshot_2024-03-15_at_2.40.12_PM.png)
![No description](https://cdn.answeroverflow.com/1218124935244021851/Screenshot_2024-03-15_at_2.43.04_PM.png)
Solution:Jump to solution
You need to listen on the port that railway provides
more info: https://docs.railway.app/guides/fixing-common-errors
```js
const port = process.env.PORT || 4000...
7 Replies
Project ID:
N/A
Solution
You need to listen on the port that railway provides
more info: https://docs.railway.app/guides/fixing-common-errors
So its 3000 not 4000
Is it??
no, it's random
app.listen({ port: 4000 }, () =>
console.log(
🚀 Server ready at http://localhost:4000${server.graphqlPath}
,
),
)
this is how , im passing the port no not in .envYou need to listen on the port that railway provides
please read this: https://docs.railway.app/guides/fixing-common-errors
in your case you can get the port by doing:
sure let me read, thanks