R
Railway•13mo ago
oz

How to get Port as Env var?

I basically want to pas in the dynamic port of my service as an environment var, dont see info on that in docs, only for TCP proxy
8 Replies
Percy
Percy•13mo ago
Project ID: N/A
oz
oz•13mo ago
N/A
MantisInABox
MantisInABox•13mo ago
The port environment variable is automatically generated, but if you want to create one specifically for a particular port just set an environment variable in your service called PORT to your desired port number
oz
oz•13mo ago
Thanks for the response. To clarify, I want to know what Railway;s dynamic port is so I can remap it to an app specific env var
MantisInABox
MantisInABox•13mo ago
It will tell you when you deploy the service in the deploy log It would just be PORT
oz
oz•13mo ago
so in my env var I would do VAR_NAME = ${PORT}
MantisInABox
MantisInABox•13mo ago
Yes
oz
oz•13mo ago
Thank you 🙂
Want results from more Discord servers?
Add your server