---
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

<b>Signature:</b>

```typescript
route(controllerClass: Constructor<object>, meta?: SocketIoMetadata | string | RegExp): Server<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any> | import("socket.io").Namespace<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  controllerClass | [Constructor](./context.constructor.md)<!-- -->&lt;object&gt; |  |
|  meta | [SocketIoMetadata](./socketio.socketiometadata.md) \| string \| RegExp | <i>(Optional)</i> |

<b>Returns:</b>

Server&lt;import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any&gt; \| import("socket.io").Namespace&lt;import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any&gt;


