The normal place for this sort of configuration would be config/config.exs or some other .exs file loaded by it. In other words, using configuration formats other than just ordinary Elixir code is generally discouraged.
That said, if you for some reason absolutely need to accept JSON configuration files specifically, the best place would still probably be something in or around config/config.exs. You’d probably need to define that function there, then call it with whatever arguments needed to load your JSON config. The resulting map (or whatever internal format used after parsing) could then be assigned to a configuration key for your OTP app.
For example (note the anonymous function in a variable; you can probably define a module in here, but whatever):
# config.exs
json_loader = fn(path) -> do_the_needful end
config :my_app, json_config: json_loader.("some_file.json")






















