title: How to create rooms with nestjs and socket.io
body: <p>I'm trying to create a room on my nestjs backend but can't find any information on this subject. You can find the docs <a href="https://docs.nestjs.com/websockets/gateways" rel="noreferrer">here</a>. The docs don't seem to have anything on this subject.</p>
  
  <pre><code>import {
    SubscribeMessage,
    WebSocketGateway,
    WebSocketServer,
    WsResponse,
  } from '@nestjs/websockets';
  import { Client, Server } from 'socket.io';
  
  @WebSocketGateway({namespace: 'story'})
  export class StoryEventsGateway {
    @WebSocketServer()
    server: Server;
  
    @SubscribeMessage('createRoom')
    createRoom(client: Client, data: string): WsResponse&lt;unknown&gt; {
      return { event: 'roomCreated', data };
    }
  }
  
  </code></pre>