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 (Optional) The key for the binding to be configured

Returns:

Binding<ConfigValueType>