R
Railway•14mo 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•14mo ago
Project ID: N/A
oz
ozOP•14mo ago
N/A
MantisInABox
MantisInABox•14mo 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
ozOP•14mo 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•14mo ago
It will tell you when you deploy the service in the deploy log It would just be PORT
oz
ozOP•14mo ago
so in my env var I would do VAR_NAME = ${PORT}
MantisInABox
MantisInABox•14mo ago
Yes
oz
ozOP•14mo ago
Thank you 🙂
Want results from more Discord servers?
Add your server