Page Contents

Home > @loopback/context > ConfigurationResolver > getConfigAsValueOrPromise

ConfigurationResolver.getConfigAsValueOrPromise() method

Resolve config for the binding key

Signature:

getConfigAsValueOrPromise<ConfigValueType>(key: BindingAddress<unknown>, propertyPath?: string, resolutionOptions?: ResolutionOptions): ValueOrPromise<ConfigValueType | undefined>;

Parameters

</tbody></table> **Returns:** [ValueOrPromise](/doc/en/lb4/apidocs.context.valueorpromise.html)<ConfigValueType \| undefined>
Parameter Type Description
key [BindingAddress](/doc/en/lb4/apidocs.context.bindingaddress.html)<unknown> Binding key
propertyPath string _(Optional)_ Property path for the option. For example, `x.y` requests for `.x.y`. If not set, the `config` object will be returned. </td></tr>
resolutionOptions [ResolutionOptions](/doc/en/lb4/apidocs.context.resolutionoptions.html) _(Optional)_ Options for the resolution. - optional: if not set or set to `true`, `undefined` will be returned if no corresponding value is found. Otherwise, an error will be thrown.