Конфиг

This commit is contained in:
Халимов Рустам
2026-03-30 22:54:31 +03:00
parent 143c0b7dc4
commit ce212c11c1

View File

@@ -0,0 +1,21 @@
using Carter;
using Knot.Modules.Settings.Application.Settings.Queries;
using Knot.Shared.Kernel;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
namespace Knot.Modules.Settings.Presentation.Endpoints;
public sealed class SettingsEndpoints : ICarterModule
{
public void AddRoutes(IEndpointRouteBuilder app)
{
app.MapGet("api/config", async (ISender sender, CancellationToken ct) =>
{
var result = await sender.Send(new GetPublicConfigQuery(), ct);
return result.IsSuccess ? Results.Ok(result.Value) : Results.BadRequest(result.Error);
});
}
}