---
lang: en
title: 'API docs: socketio.socketioserver.route'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/socketio
permalink: /doc/en/lb4/apidocs.socketio.socketioserver.route.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/socketio](./socketio.md) &gt; [SocketIoServer](./socketio.socketioserver.md) &gt; [route](./socketio.socketioserver.route.md)

## SocketIoServer.route() method

Register a socketio controller

**Signature:**

```typescript
route(controllerClass: Constructor<object>, meta?: SocketIoMetadata | string | RegExp): Server<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any> | import("socket.io").Namespace<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td markdown="1">

controllerClass


</td><td markdown="1">

[Constructor](./context.constructor.md)<!-- -->&lt;object&gt;


</td><td markdown="1">


</td></tr>
<tr><td markdown="1">

meta


</td><td markdown="1">

[SocketIoMetadata](./socketio.socketiometadata.md) \| string \| RegExp


</td><td markdown="1">

_(Optional)_


</td></tr>
</tbody></table>

**Returns:**

Server&lt;import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any&gt; \| import("socket.io").Namespace&lt;import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any&gt;


