fix: align backend APIs and upload flow
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using IM.InitCommon.Management;
|
||||
|
||||
using ConnectorService.Hubs;
|
||||
using ConnectorService.Services;
|
||||
using IM.InitCommon;
|
||||
|
||||
namespace ConnectorService
|
||||
@@ -15,6 +17,8 @@ namespace ConnectorService
|
||||
builder.ConfigureDbConfiguration();
|
||||
|
||||
builder.Services.AddSignalR();
|
||||
builder.Services.AddSingleton<ConnectionRegistry>();
|
||||
builder.Services.AddHostedService(sp => sp.GetRequiredService<ConnectionRegistry>());
|
||||
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
@@ -23,6 +27,7 @@ namespace ConnectorService
|
||||
builder.ConfigExtraServices();
|
||||
|
||||
var app = builder.Build();
|
||||
if (app.ApplyMigrationsIfRequested(args)) return;
|
||||
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
@@ -32,9 +37,12 @@ namespace ConnectorService
|
||||
}
|
||||
|
||||
app.UseAppDefault();
|
||||
app.MapManagementHealth();
|
||||
|
||||
|
||||
app.MapHub<ChatHub>("/chat");
|
||||
app.MapGet("/internal/management/connections", async (ConnectionRegistry registry) => await registry.Counts());
|
||||
app.MapPost("/internal/management/disconnect/{id:guid}", async (Guid id, ConnectionRegistry registry) => { await registry.Disconnect(id); return new { disconnected = true }; });
|
||||
|
||||
app.Run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user