@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (23 loc) • 1.22 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}`<!-- -->.
<b>Signature:</b>
```typescript
configure<ConfigValueType = BoundValue>(key?: BindingAddress): Binding<ConfigValueType>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | [BindingAddress](./context.bindingaddress.md) | The key for the binding to be configured |
<b>Returns:</b>
[Binding](./context.binding.md)<!-- --><ConfigValueType>