import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
// import { WsAdapter } from '@nestjs/platform-ws';
import { WsAdapter } from './ws-adapter';
import { Logger } from '@nestjs/common';

const port = process.env.PORT || 3100;
async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.enableCors();
  app.useWebSocketAdapter(new WsAdapter(app));

  await app.listen(port, '0.0.0.0', function () {
    const logger = new Logger('bootstrap');
    logger.log(`listening on port ${port}`);
  });
}
bootstrap();
