mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-13 00:02:30 +10:00
switch to nx monorepo
This commit is contained in:
27
apps/server/src/ws/ws.gateway.ts
Normal file
27
apps/server/src/ws/ws.gateway.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import {
|
||||
OnGatewayConnection,
|
||||
OnGatewayInit,
|
||||
SubscribeMessage,
|
||||
WebSocketGateway,
|
||||
WebSocketServer,
|
||||
} from '@nestjs/websockets';
|
||||
import { Server } from 'socket.io';
|
||||
|
||||
@WebSocketGateway({ namespace: 'events' })
|
||||
export class WsGateway implements OnGatewayInit, OnGatewayConnection {
|
||||
@WebSocketServer()
|
||||
server: Server;
|
||||
|
||||
@SubscribeMessage('message')
|
||||
handleMessage(client: any, payload: any): string {
|
||||
return 'Hello world!';
|
||||
}
|
||||
|
||||
handleConnection(client: any, ...args: any[]): any {
|
||||
//
|
||||
}
|
||||
|
||||
afterInit(server: any): any {
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user