JsonEndpoint.cs 442 B

1234567891011121314151617181920
  1. using Reaper;
  2. using Reaper.Attributes;
  3. namespace Benchmark;
  4. public class JsonResponse
  5. {
  6. public string Message { get; set; } = default!;
  7. }
  8. [ReaperRoute(HttpVerbs.Get, "/json")]
  9. public class JsonEndpoint : ReaperEndpointXR<JsonResponse>
  10. {
  11. public override Task ExecuteAsync()
  12. {
  13. Context.Response.ContentLength = 27;
  14. Result = new JsonResponse { Message = "Hello, World!" };
  15. return Task.CompletedTask;
  16. }
  17. }