This commit is contained in:
Халимов Рустам
2026-03-30 23:57:34 +03:00
parent d3f1e3f361
commit f1f8f6e012
27 changed files with 88 additions and 142 deletions

View File

@@ -1,5 +1,4 @@
using Knot.Modules.Messaging;
using Carter;
using Knot.Shared.Infrastructure;
using Knot.Modules.Auth;
using Knot.Modules.Profiles;
@@ -19,7 +18,6 @@ using System.Text;
using System.IdentityModel.Tokens.Jwt;
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Extensions.FileProviders;
using Microsoft.AspNetCore.SignalR;
using System.Security.Claims;
@@ -77,9 +75,6 @@ builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssemblies(
typeof(Knot.Modules.Klipy.DependencyInjection).Assembly
));
// Carter для вызова Minimal APIs (Endpoints)
builder.Services.AddCarter();
// Настройка CORS
builder.Services.AddCors(options =>
{
@@ -216,8 +211,20 @@ if (app.Environment.IsDevelopment())
app.UseAuthentication();
app.UseAuthorization();
// Добавляем контроллеры и Carter (Minimal APIs)
app.MapCarter();
// Регистрация эндпоинтов
app.MapAuthEndpoints();
app.MapStoriesEndpoints();
app.MapContactsEndpoints();
app.MapSettingsEndpoints();
app.MapProfilesEndpoints();
app.MapFederationEndpoints();
app.MapKlipyEndpoints();
app.MapChatsEndpoints();
app.MapMessagesEndpoints();
app.MapAdminEndpoints();
app.MapFilesEndpoints();
app.MapWebRtcEndpoints();
app.MapTelegramImportEndpoints();
// Добавляем SignalR хабы
app.MapHub<ChatHub>("/hubs/chat");