diff --git a/Hubs/SyncHub.cs b/Hubs/SyncHub.cs index 4ca5063..80c14a1 100644 --- a/Hubs/SyncHub.cs +++ b/Hubs/SyncHub.cs @@ -20,14 +20,14 @@ namespace API_SequentMicrosystems.Hubs await Clients.All.SendAsync("SyncRequested", clientID); } - public async Task SyncPoints(string clientID, object o) + public async Task SyncPoints(string clientID, string data) { - await Clients.All.SendAsync("SyncPointsData", clientID, o); + await Clients.All.SendAsync("SyncPointsData", clientID, data); } - public async Task SyncRTD8TMChart(string clientID, object o) + public async Task SyncRTD8TMChart(string clientID, string data) { - await Clients.All.SendAsync("SyncRTD8TMChartData", clientID, o); + await Clients.All.SendAsync("SyncRTD8TMChartData", clientID, data); } diff --git a/Program.cs b/Program.cs index c3adb9b..6194f83 100644 --- a/Program.cs +++ b/Program.cs @@ -2,8 +2,6 @@ using API_SequentMicrosystems.Hubs; using API_SequentMicrosystems.Services; using Microsoft.OpenApi.Models; using System.Reflection; -using System.Text.Json; -using System.Text.Json.Serialization; namespace API_SequentMicrosystems { @@ -17,6 +15,7 @@ namespace API_SequentMicrosystems builder.Services.AddControllers().AddNewtonsoftJson(); builder.Services.AddSignalR(); + builder.Services.AddSignalRCore(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); @@ -63,7 +62,8 @@ namespace API_SequentMicrosystems app.Services.GetService(); app.Services.GetService(); - app.MapHub("/signalr/sync"); + app.MapHub("/signalr"); + app.UseWebSockets(); app.MapControllers();