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

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

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

## RoutingTable.registerController() method

Register a controller as the route

<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


