HotConfig.JSONFile (hot_config v0.2.0)
Implementation of a Config.Provider
for reading config from a JSON file.
When JSON file is read then HotConfig.Resolver.merge_to_source/1
is invoked to patch primary source of config.
After that, runtime.exs
is being reread with updated primary source.
It is recommended to have a plain structure in JSON file similar to env
:
{
"ENV_NAME1": "value1",
"ENV_NAME2": "value2"
"ENV_NAME3": "value3"
}
However, structure can be more complex, but this'd require more complex logic in an implementation of a
HotConfig.Resolver.merge_to_source/1
callback.