Type Alias RouterHandler<Body>

RouterHandler<Body>: ((args: {
    body: Body;
    pathParams: Record<string, string>;
    request: Request;
}) => Promise<Response>)

Handler function for a route, which processes the request and returns a response.

Type Parameters

  • Body = any

Type declaration

    • (args): Promise<Response>
    • Parameters

      • args: {
            body: Body;
            pathParams: Record<string, string>;
            request: Request;
        }
        • body: Body
        • pathParams: Record<string, string>
        • request: Request

      Returns Promise<Response>

      A promise resolving to an HTTP response.