Push pour hugo avec quelques ajouts de fichiers

This commit is contained in:
batche
2022-12-28 16:09:25 +01:00
parent ead4a1c264
commit 3e37a16d8c
9 changed files with 197 additions and 84 deletions

View File

@@ -34,7 +34,7 @@ import { ChatGateway } from './chat/chat.gateway';
controllers: [AppController],
providers: [
AppService,
ChatGateway,
ChatGateway,
],
})
export class AppModule {}

View File

@@ -10,27 +10,23 @@ import {
@WebSocketGateway({
path: '/chat',
port: 8088,
})
/*
export class ChatGateway {
*/
export class ChatGateway implements OnGatewayConnection {
@WebSocketServer()
server;
@WebSocketServer()
server;
handleConnection(client) {
console.log('Client connected:', client.id);
}
@SubscribeMessage('message')
handleMessage(client, data): string {
return 'Hello world!';
}
handleConnection(client, ...args) {
console.log('client connected');
}
handleDisconnect(client) {
console.log('client disconnected');
}
/*
@SubscribeMessage('message')
handleMessage(@MessageBody() message: string): void {
console.log("message received:");
console.log(`[${message}]`);
this.server.emit('message', message);
}
*/
}