1. At the root of your project, create a directory called config
mkdir config
  1. Create a new configuration file called config/config.exs, it will contain your configuration.
touch config/config.exs
  1. Edit the file and add this content. import Config will import the Config module and all the meta-function. Next, the config/3 (opens new window) keyword offers the possibility to associate key/value to an application.
import Config

config :my_application,
  my_key: "my_value"
  1. Assuming my_application exist, you can now retrieve the information directly from the configuration file by using Application.fetch_env!/2 (opens new window) function
Application.fetch_env!(:my_application, :my_key)

# References and Resources