Flattened key-value pairs or nested variables
cheesam
PROOP

9 months ago

Does Railway support either key-value pairs or nested variables? I can't see anything in the docs for either.

Solved

0 Replies

dev
MODERATOR

9 months ago

N/A


dev
MODERATOR

9 months ago

Do you mean in environment variables?


cheesam
PROOP

9 months ago

Yes - I'm used to having an appSettings.json, with nested values in there.

I've got a way of accessing the environment variables, but I've had to break the convention of how I'd usually interact with them.

I'm using C# and .NET.


dev
MODERATOR

9 months ago

alright yea, railway's service variables are only key-value pairs (as are any other environment variables that I know of)
perhaps you can create an internal piece of code that fetches all the environment variables and creates an object for them?


cheesam
PROOP

9 months ago

I'm already using an internal service.

I think I've just figured out, if you flatten like this:
Service__Api__ClientSecret

then you can use as if it were nested.

Thanks for your suggestions.


dev
MODERATOR

9 months ago

Oh neat!


dev
MODERATOR

9 months ago

no worries


dev
MODERATOR

9 months ago

Clear to mark as solved?


cheesam
PROOP

9 months ago

!s


cheesam
PROOP

9 months ago

Solved


cheesam
PROOP

9 months ago

?


dev
MODERATOR

9 months ago

don't worry I got it 🤣


dev
MODERATOR

9 months ago

!s


Status changed to Solved dev 9 months ago


Loading...