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
"http://+:80"
"http://+:80"
, so should i be able to reference PORT variable in it's value? I mean something like
"http://+:${PORT}"
"http://+:${PORT}"
. Thanks.
14 Replies
Percy
Percy2y ago
Project ID: d9584449-f807-4d25-b807-f765ae62e699
НЄЛЬЗЯ СОТВОРІТЬ ЗДЄСЬ
d9584449-f807-4d25-b807-f765ae62e699
Solution
Tiago Uabeiro
Tiago Uabeiro2y ago
${{ENV_VARIABLE}}
НЄЛЬЗЯ СОТВОРІТЬ ЗДЄСЬ
Uh-huh, so double brackets should do the trick, i'll try it out, thanks!
Brody
Brody2y ago
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?
Brody
Brody2y ago
no, it doesn't need to be a shared variable
НЄЛЬЗЯ СОТВОРІТЬ ЗДЄСЬ
Just set the PORT to some value then?
Brody
Brody2y ago
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
Brody
Brody2y ago
no need for a shared PORT variable
НЄЛЬЗЯ СОТВОРІТЬ ЗДЄСЬ
Understood, thanks) And it works, thanks again)
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server