Skip to content

api.service.Configuration ​

This service is used by Hitchy's core to gather and compile current runtime's configuration during its bootstrap process.

Static methods ​

gather() ​

This method is invoked during configuration stage with the handles of discovered and exposed plugins to read either plugin's runtime configuration and compile the resulting configuration object of the application.

A promise for the resulting configuration is returned to be exposed as api.config at runtime by the caller.

javascript
const configuration = await api.service.Configuration.gather( plugins );

strategySelector() ​

This method is used by gather() on merging plugins' configurations using api.utility.object.merge(). It is provided as third argument there.

javascript
const strategy = api.service.Configuration.strategySelector( 
	segments, 
    defaultStrategy, 
    oldValue, 
    newValue
)