Page Contents

Home > @loopback/context > Context > configure

Context.configure() method

Create a corresponding binding for configuration of the target bound by the given key in the context.

For example, ctx.configure('controllers.MyController').to({x: 1}) will create binding controllers.MyController:$config with value {x: 1}.

Signature:

configure<ConfigValueType = BoundValue>(key?: BindingAddress): Binding<ConfigValueType>;

Parameters

Parameter Type Description
key [BindingAddress](/doc/en/lb4/apidocs.context.bindingaddress.html) _(Optional)_ The key for the binding to be configured

Returns:

Binding<ConfigValueType>