21 lines
483 B
C#
21 lines
483 B
C#
|
namespace Uwaa.HTTP.Routing;
|
|||
|
|
|||
|
public class StaticEndpoint : RouterBase
|
|||
|
{
|
|||
|
public HttpResponse Response;
|
|||
|
|
|||
|
public StaticEndpoint(HttpResponse response)
|
|||
|
{
|
|||
|
Response = response;
|
|||
|
}
|
|||
|
|
|||
|
public override HttpMethod Method => HttpMethod.GET;
|
|||
|
|
|||
|
public override int Arguments => 0;
|
|||
|
|
|||
|
protected override Task<HttpResponse?> GetResponseInner(HttpRequest req, HttpClientInfo info, ArraySegment<string> path)
|
|||
|
{
|
|||
|
return Task.FromResult(Response)!;
|
|||
|
}
|
|||
|
}
|