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

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

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [HttpHandler](./rest.httphandler.md) &gt; [registerController](./rest.httphandler.registercontroller.md)

## HttpHandler.registerController() method

<b>Signature:</b>

```typescript
registerController<T>(spec: ControllerSpec, controllerCtor: ControllerClass<T>, controllerFactory?: ControllerFactory<T>): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  spec | [ControllerSpec](./openapi-v3.controllerspec.md) |  |
|  controllerCtor | [ControllerClass](./rest.controllerclass.md)<!-- -->&lt;T&gt; |  |
|  controllerFactory | [ControllerFactory](./rest.controllerfactory.md)<!-- -->&lt;T&gt; | <i>(Optional)</i> |

<b>Returns:</b>

void


