Route.websocket constructor

Route.websocket(
  1. String name, {
  2. required WebSocketResource websocket,
  3. List<ModularMiddleware> middlewares = const [],
})

Implementation

factory Route.websocket(
  String name, {
  required WebSocketResource websocket,
  List<ModularMiddleware> middlewares = const [],
}) {
  return Route._(
    handler: websocket.handler,
    name: name,
    schema: 'GET',
    middlewares: middlewares,
  );
}