middlewares library

Functions

createMiddleware({FutureOr<Response?> requestHandler(Request)?, FutureOr<Response> responseHandler(Response)?, FutureOr<Response> errorHandler(Object error, StackTrace)?}) Middleware
Creates a Middleware using the provided functions.
error({bool debug = false, ErrorHandler? errorHandler}) Middleware
Middleware which catches errors thrown by inner handlers and returns a response with a 500 status code.
logRequests({void logger(String message, bool isError)?}) Middleware
Middleware which prints the time of the request, the elapsed time for the inner handlers, the response's status code and the request URI.