UNPKG

@loopback/docs

Version:
36 lines (23 loc) 1.54 kB
--- lang: en title: 'API docs: context.configurationresolver.getconfigasvalueorpromise' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar permalink: /doc/en/lb4/apidocs.context.configurationresolver.getconfigasvalueorpromise.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [ConfigurationResolver](./context.configurationresolver.md) &gt; [getConfigAsValueOrPromise](./context.configurationresolver.getconfigasvalueorpromise.md) ## ConfigurationResolver.getConfigAsValueOrPromise() method Resolve config for the binding key <b>Signature:</b> ```typescript getConfigAsValueOrPromise<ConfigValueType>(key: BindingAddress<unknown>, configPath?: string, resolutionOptions?: ResolutionOptions): ValueOrPromise<ConfigValueType | undefined>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | key | <code>BindingAddress&lt;unknown&gt;</code> | Binding key | | configPath | <code>string</code> | Property path for the option. For example, <code>x.y</code> requests for <code>&lt;config&gt;.x.y</code>. If not set, the <code>config</code> object will be returned. | | resolutionOptions | <code>ResolutionOptions</code> | Options for the resolution. - optional: if not set or set to <code>true</code>, <code>undefined</code> will be returned if no corresponding value is found. Otherwise, an error will be thrown. | <b>Returns:</b> `ValueOrPromise<ConfigValueType | undefined>`