Environment variable to reference other environment variables
Hello, in railway, are environment variables able to reference other variables? I.e. for ASP.NET to set ports i would use ASPNETCORE_URLS variable with value , so should i be able to reference PORT variable in it's value? I mean something like .
Thanks.
Solution:Jump to solution
yes you can do something like that
https://docs.railway.app/develop/variables#reference-variables...
14 Replies
Project ID:
d9584449-f807-4d25-b807-f765ae62e699
d9584449-f807-4d25-b807-f765ae62e699
Solution
yes you can do something like that
https://docs.railway.app/develop/variables#reference-variables
${{ENV_VARIABLE}}
Uh-huh, so double brackets should do the trick, i'll try it out, thanks!
but word of warning, to use the PORT variable in a reference, you would need to add a PORT variable to the service variables yourself
So something like this?
no, it doesn't need to be a shared variable
Just set the PORT to some value then?
just a regular service variable yep, you can remove the PORT from the shared variables
Do`h I thought it was shared by default, I guess i added it myself
no need for a shared PORT variable
Understood, thanks)
And it works, thanks again)
no problem!