### Defining Basic Configuration and Extension in Elixir with ExConf Source: https://github.com/phoenixframework/ex_conf/blob/master/README.md This snippet demonstrates how to define a basic configuration module using `use ExConf.Config`, set configuration values with the `config` macro, and access them. It also shows how to create a new configuration module that extends an existing one, allowing for overrides while inheriting defaults. ```Elixir defmodule MyApp.Config do use ExConf.Config config :router, ssl: true, domain: "example.dev", port: System.get_env("PORT") config :session, secret: "secret" end iex> MyApp.Config.router[:domain] "example.dev" defmodule MyApp.OtherConfig do use MyApp.Config config :session, secret: "123password" end iex> MyApp.OtherConfig.session[:secret] "123password" iex> MyApp.OtherConfig.router[:ssl] true ``` -------------------------------- ### Defining Base Configuration for Environment Lookup in Elixir with ExConf Source: https://github.com/phoenixframework/ex_conf/blob/master/README.md This code defines a base configuration module using `ExConf.Config` and specifies an environment variable (`env_var: "MIX_ENV"`) that ExConf should use to determine the current environment at runtime. This base module provides default settings that can be overridden by environment-specific submodules. ```Elixir defmodule MyApp.Config do use ExConf.Config, env_var: "MIX_ENV" config :router, ssl: true config :twitter, api_token: System.get_env("API_TOKEN") end ``` -------------------------------- ### Defining Environment-Specific Configuration in Elixir with ExConf Source: https://github.com/phoenixframework/ex_conf/blob/master/README.md This snippet shows how to define a configuration module specific to an environment (e.g., `Dev`) by extending the base configuration module (`MyApp.Config`). This submodule provides settings that override the base configuration when the specified environment variable matches its name (capitalized). The `MyApp.Config.env/0` function is used to access the configuration for the currently active environment. ```Elixir defmodule MyApp.Config.Dev do use MyApp.Config config :router, ssl: false config :twitter, api_token: "ABC" end iex> System.get_env("MIX_ENV") "dev" iex> MyApp.Config.env MyApp.Config.Dev iex> MyApp.Config.env.router[:ssl] false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.