Middleware.shelf constructor

Middleware.shelf(
  1. Function handler, {
  2. List<String> routes = const ['*'],
  3. bool ignoreResponse = true,
})

The shelf factory constructor is used to create a new instance of the Middleware class.

It accepts a shelf.Middleware or a shelf.Handler object.

It is used to create a middleware from a shelf middleware giving interoperability between Serinus and Shelf.

Implementation

factory Middleware.shelf(Function handler,
    {List<String> routes = const ['*'], bool ignoreResponse = true}) {
  return _ShelfMiddleware(handler,
      routes: routes, ignoreResponse: ignoreResponse);
}