R
Railway16mo ago
JerZ

Error: listen EADDRNOTAVAIL: address not available 104.196.232.237:8080

server.listen(8080, 'parsimonious-push-production.up.railway.app', () => {
console.log('Server running at http://parsimonious-push-production.up.railway.app:8080/');
});
server.listen(8080, 'parsimonious-push-production.up.railway.app', () => {
console.log('Server running at http://parsimonious-push-production.up.railway.app:8080/');
});
Im trying to host a js file that is listening to http request, some kind of my own api. But when I deploy it shows this error: Error: listen EADDRNOTAVAIL: address not available 104.196.232.237:8080 parsimonious-push-production.up.railway.app is the generated free domain from the railway app.
7 Replies
Percy
Percy16mo ago
Project ID: N/A
JerZ
JerZ16mo ago
N/A
Brody
Brody16mo ago
You want to use 0.0.0.0 as the host to listen on
Adam
Adam16mo ago
If it's trying to listen to itsself, yes. If it's trying to listen to another API that you've hosted then use the Railway generated link Just clarifying, Brody is right here
JerZ
JerZ16mo ago
I want another domain to request http to that, so which one do I use?
Brody
Brody16mo ago
From outside of your app you make requests to the railway provided domain, but for your app to accept requests it needs to listen on 0.0.0.0 aka all interfaces You'll also want to listen on process.env.PORT
JerZ
JerZ16mo ago
ah ok, thx