R
Railway10mo ago
loyahdev

my node js api isn’t getting a domain

Idk why
No description
15 Replies
Percy
Percy10mo ago
Project ID: fec32241-499a-4c5b-af0d-826fa71978bb
loyahdev
loyahdevOP10mo ago
fec32241-499a-4c5b-af0d-826fa71978bb Like I did this already: app.listen(port, "0.0.0.0", function () { console.log(Server running at http://localhost:${port}); });
Fragly
Fragly10mo ago
To give your API a domain, you'd want to go to service settings and generate a domain where are you defining the port variable?
loyahdev
loyahdevOP10mo ago
Top of my script It’s just port = 3000
Fragly
Fragly10mo ago
you're not listening to the PORT railway provides, you need to have your app listen on the PORT environment variable
const port = process.env.PORT || 3000;
const port = process.env.PORT || 3000;
read this for more info: https://docs.railway.app/guides/fixing-common-errors
loyahdev
loyahdevOP10mo ago
But every time before railway usually generates one automatically Why so? I can use an env if I need to
Fragly
Fragly10mo ago
Railway exposes a specific port when you deploy your app and routes requests from your domain to that port, for your app to receive those requests it needs to be listening to the port that railway exposes for your app, that port being in the PORT variable
loyahdev
loyahdevOP10mo ago
i see it works now thats. But can you help with this aswell please?
Fragly
Fragly10mo ago
What is zsign, is it a binary in your repo?
Brody
Brody10mo ago
@loyahdev ping for visibility
loyahdev
loyahdevOP10mo ago
its an app signer for iphone apps you input an apple development certificate and it signs the app
Brody
Brody10mo ago
okay and the second part of the question?
loyahdev
loyahdevOP10mo ago
and yes it is a binary its an executable sh file i fixed it by using chmod +x
Brody
Brody10mo ago
that was the solution fragly was going to propose, we just needed more information first to be sure if that would be the best solution
loyahdev
loyahdevOP10mo ago
yup ill add more info later on in requests sorry
Want results from more Discord servers?
Add your server