Flattened key-value pairs or nested variables

2 years ago

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

Solved

13 Replies

2 years ago

N/A


2 years ago

Do you mean in environment variables?


2 years 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.


2 years 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?


2 years 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.


2 years ago

Oh neat!


2 years ago

no worries


2 years ago

Clear to mark as solved?


2 years ago

!s


2 years ago

Solved


2 years ago

?


2 years ago

don't worry I got it 🤣


2 years ago

!s


Status changed to Solved dev • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...