#How to get Port as Env var?

10 messages · Page 1 of 1 (latest)

mortal night
#

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

astral bisonBOT
#

Project ID: N/A

mortal night
#

N/A

tepid merlin
#

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

mortal night
#

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

tepid merlin
#

It will tell you when you deploy the service in the deploy log

#

It would just be PORT

mortal night
#

so in my env var I would do

VAR_NAME = ${PORT}

tepid merlin
#

Yes