LANCommander/LANCommander.Server/Startup/SignalR.cs

24 lines
662 B
C#
Raw Permalink Normal View History

2025-03-11 21:21:16 -05:00
using LANCommander.Server.Hubs;
namespace LANCommander.Server.Startup;
public static class SignalR
{
public static void AddSignalR(this WebApplicationBuilder builder)
{
builder.Services.AddSignalR().AddJsonProtocol(static options =>
{
options.PayloadSerializerOptions.PropertyNamingPolicy = null;
});
}
public static WebApplication UseSignalR(this WebApplication app)
{
app.MapHub<RpcHub>("/rpc");
2025-03-11 21:21:16 -05:00
app.MapHub<GameServerHub>("/hubs/gameserver");
app.MapHub<LoggingHub>("/logging");
app.MapHub<ScriptDebuggerHub>("/RPC/ScriptDebugger");
2025-03-11 21:21:16 -05:00
return app;
}
}