Configuration
kermit provides an unified and mighty configuration system. Read how it works and how to use it with your kermit based app.
The kermit service configuration system is aware of defining app dependent services, configuring these services
and splitting the configuration into multiple files.
Service Definition
The dependent application services are defined in app.services
.
Each service definition of the services hash may be a service constructor or an object with the following keys:
- service: kermit.Service (required) the service constructor
- configKey: String (optional) the service config key
A valid service definition may look like:
{
app: {
services: {
srv1: Service1,
srv2: {
service: Service2
},
srv3: {
service: Service3,
configKey: 'srv3.config.key'
}
}
}
}
All defined services will be instantiated, configured, bootstrapped and launched during the app lifecycle.
Service Configuration
The service config key is the key that is used to read the service config from.
It can be defined and overridden on different layers.
- If there is a
configKey
setting in the service definition, this one used to read the service config from. - If not, in case the service provides a
getConfigKey() : String
method, the return value will be used as config key. - If not, the kermit app looks for a static
CONFIG_KEY
property on the service class. - If neither exist, it falls back to the service key for which the service is defined.
Updated less than a minute ago