Handling environment variables in Elixir/Phoenix applications
A simple approach to setting configuration values using environment variables in an Elixir/Phoenix application.
The nice thing about this approach is that all configuration fetching within the app is done in one module for easier debugging and finding a list of variables that can be set.
Setting configuration values
Fetching configuration values
Usage within a module
# Within another module... StaticConfiguration.some_value()
Hopefully this saves you some time. I couldn't find a straightforward way to do this with a quick search on the web and spent a few hours pounding my head on the table to figure this out. Happy coding! SL