Config.cs 506 B

123456789101112131415161718192021
  1. using MediatR;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Config;
  4. internal sealed class Config : IEndpoint
  5. {
  6. public void MapEndpoint(IEndpointRouteBuilder app)
  7. {
  8. app.MapGet("api/config", async (
  9. ISender sender,
  10. CancellationToken ct
  11. ) => {
  12. var result = await sender.Send(new Application.Features.Config.Get.Query(), ct);
  13. return ApiResponse.Ok(result);
  14. })
  15. .WithTags("Config")
  16. .AllowAnonymous();
  17. }
  18. }