@bearnjs/rest
    Preparing search index...

    Type Alias RouteHandler<TParams, TQuery, TBody, TResponse>

    RouteHandler: (
        req: Request<TParams, TQuery, TBody>,
        res: Response<TResponse>,
        next: NextFunction,
    ) => void | Response | Promise<void | Response>

    Defines a strongly-typed route handler function.

    Type Parameters

    • TParams extends Record<string, string> = Record<string, string>

      The type of the URL parameters.

    • TQuery extends Record<string, string> = Record<string, string>

      The type of the query parameters.

    • TBody extends JsonValue = JsonValue

      The type of the request body.

    • TResponse extends JsonValue = JsonValue

      The type of the response.

    Type Declaration