R
Railway2y ago
Jer

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
Percy2y ago
Project ID: N/A
Jer
JerOP2y ago
N/A
Brody
Brody2y ago
You want to use 0.0.0.0 as the host to listen on
Adam
Adam2y 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
Jer
JerOP2y ago
I want another domain to request http to that, so which one do I use?
Brody
Brody2y 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
Jer
JerOP2y ago
ah ok, thx
Want results from more Discord servers?
Add your server