Skip to content

Namespace Decorator

The namespace decorator is responsible for registering a namespace to work with websockets. A websocket connection will be only accepted if the namespace is registered.

Usage

typescript
@Namespace('/foo') // register the namespace
@Controller('/api/playground')
@Middleware(FirstMiddleware)
export default class DummyController {}

Now you can connect to websockets using the /foo namespace, example:

typescript
new WebSocket('http://localhost:3001/foo');

See Also