Page Contents

Home > @loopback/socketio > SocketIoServer > route

SocketIoServer.route() method

Register a socketio controller

Signature:

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

Parameter Type Description
controllerClass [Constructor](/doc/en/lb4/apidocs.context.constructor.html)<object>
meta [SocketIoMetadata](/doc/en/lb4/apidocs.socketio.socketiometadata.html) \| string \| RegExp _(Optional)_

Returns:

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>