View Source Lightning.Config.Bootstrap (Lightning v2.10.4)

Bootstrap the application environment.

This module is responsible for setting up the application environment based on the configuration provided by the user.

Usually, config calls are made in the config/runtime.exs file. This module abstracts the runtime configuration into a module that can be tested and called from other places (aside from config/runtime.exs) file.

Sourcing envs

Internally this module uses Dotenvy.source/1 to source environment variables from the .env, .env.<config_env>, and .env.<config_env>.override files. It also sources the system environment variables.

Calling configure/0 without calling source_envs/0 or Dotenvy.source/2 first will result in no environment variables being loaded.

Usage:

Lightning.Config.Bootstrap.source_envs()
Lightning.Config.Bootstrap.configure()

Summary

Functions

Retrieve a value nested in the application environment.

Functions

Retrieve a value nested in the application environment.

It first searches the current process's config dictionary, then falls back to the application environment.