R
Railway•8mo ago
tech

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
No description
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...
Jump to solution
7 Replies
Percy
Percy•8mo ago
Project ID: N/A
Solution
Fragly
Fragly•8mo ago
You need to listen on the port that railway provides more info: https://docs.railway.app/guides/fixing-common-errors
const port = process.env.PORT || 4000
const port = process.env.PORT || 4000
tech
tech•8mo ago
So its 3000 not 4000 Is it??
Fragly
Fragly•8mo ago
no, it's random
tech
tech•8mo ago
app.listen({ port: 4000 }, () => console.log( 🚀 Server ready at http://localhost:4000${server.graphqlPath}, ), ) this is how , im passing the port no not in .env
Fragly
Fragly•8mo ago
You 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:
const port = process.env.PORT || 4000
const port = process.env.PORT || 4000
tech
tech•8mo ago
sure let me read, thanks
Want results from more Discord servers?
Add your server