From ce212c11c15adbaa40783c10262126ba4cc3a454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Mon, 30 Mar 2026 22:54:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Endpoints/SettingsEndpoints.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 backend/src/Modules/Settings/Presentation/Endpoints/SettingsEndpoints.cs diff --git a/backend/src/Modules/Settings/Presentation/Endpoints/SettingsEndpoints.cs b/backend/src/Modules/Settings/Presentation/Endpoints/SettingsEndpoints.cs new file mode 100644 index 0000000..961865b --- /dev/null +++ b/backend/src/Modules/Settings/Presentation/Endpoints/SettingsEndpoints.cs @@ -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); + }); + } +}