my node js api isn’t getting a domain

Idk why
No description
15 Replies
Percy
Percy9mo ago
Project ID: fec32241-499a-4c5b-af0d-826fa71978bb
loyahdev
loyahdev9mo 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
Fragly9mo 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
loyahdev9mo ago
Top of my script It’s just port = 3000
Fragly
Fragly9mo 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
loyahdev9mo ago
But every time before railway usually generates one automatically Why so? I can use an env if I need to
Fragly
Fragly9mo 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
loyahdev9mo ago
i see it works now thats. But can you help with this aswell please?
Fragly
Fragly9mo ago
What is zsign, is it a binary in your repo?
Brody
Brody9mo ago
@loyahdev ping for visibility
loyahdev
loyahdev9mo ago
its an app signer for iphone apps you input an apple development certificate and it signs the app
Brody
Brody9mo ago
okay and the second part of the question?
loyahdev
loyahdev9mo ago
and yes it is a binary its an executable sh file i fixed it by using chmod +x
Brody
Brody9mo 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
loyahdev9mo ago
yup ill add more info later on in requests sorry
Want results from more Discord servers?
Add your server