@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
67 lines (35 loc) • 1.4 kB
Markdown
---
lang: en
title: 'API docs: context.context.configure'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.context.configure.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [configure](./context.context.configure.md)
## 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:**
```typescript
configure<ConfigValueType = BoundValue>(key?: BindingAddress): Binding<ConfigValueType>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
key
</td><td markdown="1">
[BindingAddress](./context.bindingaddress.md)
</td><td markdown="1">
_(Optional)_ The key for the binding to be configured
</td></tr>
</tbody></table>
**Returns:**
[Binding](./context.binding.md)<!-- --><ConfigValueType>