core library

Classes

Application
An object that defines the behavior specific to application.
MessageHub
An object that sends and receives messages between Applications.
Request
An HTTP request to be processed by a Shelf application.
Response
The response returned by a Handler.

Extensions

HandlerExtension on Handler
An extension on the Handler class that provides additional functionality.
MiddlewareExtension on Middleware
An extension on the Middleware class that provides additional functionality.
RequestExtension on Request
An extension on the Request class that provides additional functionality.
ResponseExtension on Response
An extension on the Response class that provides additional functionality.

Functions

createMiddleware({FutureOr<Response?> requestHandler(Request)?, FutureOr<Response> responseHandler(Response)?, FutureOr<Response> errorHandler(Object error, StackTrace)?}) Middleware
Creates a Middleware using the provided functions.

Typedefs

ApplicationFactory = FutureOr<Application> Function()
A factory function that creates an Application.
ErrorHandler = FutureOr<Response> Function(Request request, Object error, StackTrace stackTrace)
A function that handles an error thrown by a Handler.
Handler = FutureOr<Response> Function(Request request)
A function which handles a Request.
HandlerFactory = FutureOr<Handler> Function()
A factory function that creates a Handler.
Middleware = Handler Function(Handler innerHandler)
A function which creates a new Handler by wrapping a Handler.

Exceptions / Errors

HijackException
An exception used to indicate that a request has been hijacked.