toWebHandler function

Future<Response> Function(Request) toWebHandler(
  1. Spry app
)

Creates a new web handler for the Spry application.

Implementation

Future<web.Response> Function(web.Request) toWebHandler(Spry app) {
  final handler = toHandler(app);

  return (webRequest) async {
    final event = createWebEvent(app, webRequest);
    final response = await handler(event);

    return toWebResponse(response);
  };
}