@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
26 lines (17 loc) • 910 B
Markdown
---
lang: en
title: 'API docs: rest.controllerfactory'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.controllerfactory.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [ControllerFactory](./rest.controllerfactory.md)
## ControllerFactory type
A factory function to create controller instances synchronously or asynchronously
<b>Signature:</b>
```typescript
export declare type ControllerFactory<T extends ControllerInstance> = (ctx: Context) => ValueOrPromise<T>;
```
<b>References:</b> [ControllerInstance](./rest.controllerinstance.md)<!-- -->, [Context](./context.context.md)<!-- -->, [ValueOrPromise](./context.valueorpromise.md)