mirror of
https://github.com/ryzij/AMessanger-Server.git
synced 2026-09-18 19:25:38 +00:00
13 lines
359 B
C#
13 lines
359 B
C#
using Microsoft.AspNetCore.SignalR;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace AMessanger.Core.Hubs;
|
|
|
|
public class ChatHub(ILogger<ChatHub> logger) : Hub
|
|
{
|
|
public async Task SendMessage(string user, string message)
|
|
{
|
|
logger.LogInformation($"{user}: {message}");
|
|
await Clients.All.SendAsync("ReceiveMessage", user, message);
|
|
}
|
|
} |