---
lang: en
title: 'API docs: rest.createcontrollerfactoryforclass'
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.createcontrollerfactoryforclass.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [createControllerFactoryForClass](./rest.createcontrollerfactoryforclass.md)

## createControllerFactoryForClass() function

Create a controller factory function for a given class

**Signature:**

```typescript
export declare function createControllerFactoryForClass<T extends object>(controllerCtor: ControllerClass<T>): ControllerFactory<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  controllerCtor | [ControllerClass](./rest.controllerclass.md)<!-- -->&lt;T&gt; | Controller class |

**Returns:**

[ControllerFactory](./rest.controllerfactory.md)<!-- -->&lt;T&gt;


