Push pour hugo avec quelques ajouts de fichiers
This commit is contained in:
@@ -34,7 +34,7 @@ import { ChatGateway } from './chat/chat.gateway';
|
||||
controllers: [AppController],
|
||||
providers: [
|
||||
AppService,
|
||||
ChatGateway,
|
||||
ChatGateway,
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user