• WebSocket route decorator.

    @WebSocketRoute() is a route decorator function for WebSocket routes. If you want to define a WebSocket route with this @WebSocketRoute decorator, please don't forget to call the WebSocketAdaptor.upgrade function to the INestApplication instance.

    Also, WebSocketRoute is a module containing parameter decorator functions of below for the @WebSocketRoute decorated method, at the same time. Note that, every parameters must be decorated by one of the parameter decorators in the WebSocketRoute module. One thing more important is, WebSocketRoute.Acceptor decorated parameter must be defined in the method. If not, it would be both compilation/runtime error.

    For reference, key difference between @WebSocketGateway() of NestJS and @WebSocketRoute() of Nestia is, @WebSocketRoute() can make multiple WebSocket routes by configuring paths, besides @WebSocketGateway() can't do it.

    Furthermore, if you build SDK (Software Development Kit) library through @nestia/sdk, you can make safe WebSocket client taking advantages of TypeScript type hints and checkings.

    Parameters

    • Optionalpath: string | string[]

      Path(s) of the WebSocket request

    Returns MethodDecorator

    Method decorator

    Jeongho Nam - https://github.com/samchon