import {
  WebSocketGateway,
  WebSocketServer,
  OnGatewayInit
} from '@nestjs/websockets';
import { Server } from 'socket.io';

@WebSocketGateway({ cors: true })
export class RecordGateway implements OnGatewayInit {

  @WebSocketServer()
  server: Server;

  afterInit() {
    console.log("Socket ready");
  }

  sendCount(count: number) {
    console.log("count: "+count);
    this.server.emit("countUpdate", count);
  }
}
