Апи
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user