Unable to find the deployment URL on railway project
I have a nestjs project using postgres. I succesfully deployed the application and the database is also linked, but I am unable to find the nestjs deployement link setup by railway app. Need some help
![No description](https://cdn.answeroverflow.com/1182693692344111156/Screenshot_2023-12-08_at_15.42.15.png)
19 Replies
Project ID:
1d273f0b-fde3-4c52-8939-0603176da3c2
1d273f0b-fde3-4c52-8939-0603176da3c2
On the
core
service, you can select "settings" and there will be a button to "generate domain"
Click that button and give it a few minutes to fully propagate DNS and you will be able to use that domain that is generated for you.No such button for me to generate the domain
![No description](https://cdn.answeroverflow.com/1182694226312572968/Screenshot_2023-12-08_at_15.44.13.png)
That is the individual project settings. You want to click on the "core" service and the settings tab like in the screenshot below
![No description](https://cdn.answeroverflow.com/1182694788496101397/Screenshot_20231208_084615.png)
thank you, finally found it! I am very grateful.
But the deployment link generated isn't accesible, I have tried using curl over the endpoint. It's unreachable. Is there anything else I need to do
Can you show me the deploy logs for your Core service?
![No description](https://cdn.answeroverflow.com/1182700774984261642/Screenshot_2023-12-08_at_16.10.26.png)
Perfect. So, your application is not listening on the
PORT
environment variable, it is listening specifically on port 3000. You will need to add an environment variable of PORT
to your service under the VARIABLES
tab. Call it PORT
and set the value to 3000
, let the redeploy happen, and everything should be solidright now the port is hardcoded in the system
so the port is still still working, no? π€
the PORT in my env variable is the port for database within the system
Railway automatically assigns a random port. Since you are specifically listening on port 3000, you need to set an environment variable on the service... You should not be using PORT as your environment variable for the database. PORT is what your application listens on.
understood π let me try it out
Tried it, the URL is still not being accesible.
The logs remain the same, since the PORT is 3000 but now coming from env variables
Can you share your environment variable screen. You don't have to expose the values of the variables
I have shared the env var list along with how my main.ts looks like nestjs application
![No description](https://cdn.answeroverflow.com/1182709719161372724/Screenshot_2023-12-08_at_16.45.33.png)
![No description](https://cdn.answeroverflow.com/1182709719522103438/Screenshot_2023-12-08_at_16.45.43.png)
Okay, since you are using
process.env.PORT || 3000
you can remove the PORT
environment variable, and it will use the randomly assigned port provided by Railway. Are there any errors showing in the deploy logs when you try to access the application?