I think your strategy helps us avoiding using a macro. You’d start the supervision tree of the library with the name passed in (making it a mandatory option) and all calls in the library would pass that name, right?
Its common for people to use config.exs for this but its not necessary to do so. You can just as easily do something like this:
I think that using a compile environment variable for a runtime decision this is tricky and not proper in my opinion. Sandbox is an application environment and not a compilation/configuration environment and the user’s app would probably be compiled with MIX_ENV=prod to hit sandbox. So, I think that in your MIX_ENV=prod there would be calls to System.fetch_env and I think it is a valid use for config.exs.
I did not know about vapor! Thanks for poiting that out ![]()






















