Question · NestJS course · Module 5: WebSockets

The @WebSocketGateway Decorator

What does the @WebSocketGateway() decorator do in NestJS?

Answer options

  • Creates a new HTTP server
  • Encrypts network connections
  • Converts a REST controller to WebSocket
  • Marks a class as a WebSocket gateway handling real-time connections

You can check the correct answer by solving this task in the CodeWorlds game.