Flattened key-value pairs or nested variables

a year ago

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

Solved

13 Replies

a year ago

N/A


a year ago

Do you mean in environment variables?


a year 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.


a year 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?


a year 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.


a year ago

Oh neat!


a year ago

no worries


a year ago

Clear to mark as solved?


a year ago

!s


a year ago

Solved


a year ago

?


a year ago

don't worry I got it 🤣


a year ago

!s


Status changed to Solved dev about 1 year ago


Loading...