feat(CUB-55): add SignalR broadcast state method with AgentStatusHub and DTO

This commit is contained in:
cubecraft-agents[bot]
2026-04-26 11:25:31 +00:00
parent 7b7b070dac
commit 6cf8d7fe5f
3 changed files with 237 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
using ControlCenter.Api.Data;
using ControlCenter.Api.Hubs;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
@@ -6,6 +7,9 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddOpenApi();
// Register SignalR for real-time agent status updates
builder.Services.AddSignalR();
// Register DbContext with PostgreSQL
builder.Services.AddDbContext<AppDbContext>(options =>
{
@@ -28,4 +32,7 @@ if (app.Environment.IsDevelopment())
app.UseHttpsRedirection();
// Map SignalR hubs
app.MapHub<AgentStatusHub>("/hubs/agent-status");
app.Run();