namespace Uwaa.HTTP.Routing; public delegate Task FuncEndpointDelegateAsync(HttpRequest req, HttpClientInfo info); public delegate HttpResponse? FuncEndpointDelegate(HttpRequest req, HttpClientInfo info); public class FuncEndpoint : RouterBase { public FuncEndpointDelegateAsync Function; public FuncEndpoint(FuncEndpointDelegateAsync function) { Function = function; } public override HttpMethod Method => HttpMethod.Any; public override int Arguments => 0; protected override Task GetResponseInner(HttpRequest req, HttpClientInfo info, ArraySegment path) { return Function(req, info); } }