Code
·
18 lines
·
459 bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18using Broadcast.Services;
var builder = WebApplication.CreateBuilder(args);
// BroadcastHub must be singleton: one shared instance holds the init segment
// and the per-viewer channel dictionary used by all controller requests.
builder.Services.AddSingleton<BroadcastHub>();
builder.Services.AddControllers();
var app = builder.Build();
// Serve wwwroot/index.html for GET /
app.UseDefaultFiles();
app.UseStaticFiles();
app.MapControllers();
app.Run();