Title: aah framework Configuration Desc: The configuration syntax used by aah framework is forge syntax which is very similar to HOCON syntax. aah uses enhanced version of forge by the author of aah framework. Keywords: aah config, aah configuration, HOCON, forge, config syntax, configuration syntax, aah.conf, routes.conf, security.conf, aah.project
The configuration syntax used by aah framework is forge
developed by @brettlangdon which is very similar to HOCON syntax. aah uses enhanced version of forge by the author of aah @jeevatkm. Syntax applies to aah.conf
, routes.conf
, security.conf
, i18n
message files and aah.project
file.
- Comments
- Braces
- Supported value types
- Key-value separator
- Includes
- Environment Variables
- Substitutions/Reference
- The line starts with
#
considered as comment. - You can have same line comment after
;
. For e.g:identifier = "value"; # comment here
- Root doesn't start with curly braces.
- Section must have curly braces - values are enclosed with opening and closing brace.
String
- must be quoted stringInteger
- positive and negative value supportedFloat
- positive and negative value supportedBoolean
- true or false of any case (e.g. TRUE, True, true, FALSE, False, false)Null
- nullList/Array
- string, integer, float supported. Values are separated by commas and surrounded by brackets. It can be multi line tooOS Environment variables
- $ENV_VAR - More info below
- The
=
character used to separate keys from values. - The key can have
underscore
in it.
An include statement tells the config parser to include the contents of another config file where the include statement is defined. Includes are in the format include "<pattern>"
. The <pattern>
can be any glob like pattern which is compatible with path.filepath.Match. It can be absolute path or relative path to config
directory.
# Environment profile configurations
# Load all the configuration files from `appbasedir/config/env/*.conf`.
include "./env/*.conf"
An environment is a way to pull in environment variables into your config. Environment variables are identifiers which start with a dollar sign (For example: $PATH
). Environment variables are always represented as strings and are evaluated at parse time. Adapted to supported value type.
instance_name = $AAH_INSTANCE_NAME
Substitutions/Reference are a way of referring to other parts of the configuration into another identifier.
- Global Reference - An identifier which may contain periods, the references are resolved from the global section. For example:
global_value
,section.sub_section.value
. - Local Reference - An identifier which main contain periods which starts with a period, the references are resolved from the settings current section. For example:
.value
,.sub_section.value
.