How does the JSON config format get exposed to a program?

I have a Go program that, before trying out Railway, would read in a .yaml file and parse that into a config structure. I'd prefer to not rework that setup to support environment variables, and I see that one can supply a JSON object instead. How does that get loaded? Does it get passed in as a string in an environment variable, or as a file with a certain name, or something like that?
Solution:
the JSON entry in the web UI is provided for convenience, it only supports a single level object with key value pairs
Jump to solution
7 Replies
Percy
Percy2y ago
Project ID: N/A
glotchimo
glotchimo2y ago
N/A
Brody
Brody2y ago
they are injected as regular system environment variables and can be read with os.Getenv("SPECIAL_KEY")
glotchimo
glotchimo2y ago
Does the object support any nesting or does it have to be flat?
Solution
Brody
Brody2y ago
the JSON entry in the web UI is provided for convenience, it only supports a single level object with key value pairs
glotchimo
glotchimo2y ago
Alright, thank you!
Brody
Brody2y ago
no problem!
Want results from more Discord servers?
Add your server