angel3_configuration 4.0.1 angel3_configuration: ^4.0.1 copied to clipboard
Automatic YAML application configuration loader for Angel, with .env support.
Angel3 Configuration Loader #
Automatic YAML configuration loader for Angel3 framework
Any web app needs different configuration for development and production. This plugin will search
config/default.yaml file. If it is found, configuration from it is loaded into
Then, it will look for a
config/$ANGEL_ENV file. (i.e. config/development.yaml). If this found, all of its
configuration be loaded, and will override anything loaded from the
default.yaml file. This allows for your
app to work under different conditions without you re-coding anything. :)
dependencies: angel3_configuration: ^3.0.0
# Define normal YAML objects some_key: foo this_is_a_map: a_string: "string" another_string: "string"
You can also load configuration from the environment:
# Loaded from the environment system_path: $PATH
.env file is present in your configuration directory (i.e.
config/.env), then it will be loaded before
applying YAML configuration.
You can also include values from one file into another:
_include: - "./include-prod.yaml" - "./include-misc.yaml" _include: "just-one-file.yaml"
configuration(). The loaded configuration will be available in your application's
configuration also accepts a
The former will allow you to search in a directory other than
config, and the latter lets you
$ANGEL_ENV by specifying a specific configuration name to look for (i.e.
This package uses
internally, so existing configurations can be deeply merged.
# default.yaml foo: bar: baz quux: hello # production.yaml foo: quux: goodbye yellow: submarine # Propagates to: foo: bar: baz quux: goodbye yellow: submarine