Handler.simpleCall constructor

Handler.simpleCall(
  1. String path,
  2. Future<Response> onRequest(
    1. RequestContext context,
    2. Map<String, dynamic> body
    )
)

Creates a handler that can be used to handle a request to a Future<T> Endpoint.

Implementation

factory Handler.simpleCall(
    String path,
    Future<Response> Function(
            RequestContext context, Map<String, dynamic> body)
        onRequest) {
  return Handler(
    path: path,
    onRequest: simpleCall(onRequest),
  );
}