Typealiases
The following typealiases are available globally.
-
The definition of the closure type that is used by the
Router
class when routing HTTP requests to closure.Parameter
Parameter request: TheRouterRequest
object that is used to work with the incoming request.Parameter
Parameter response: TheRouterResponse
object used to send responses to the HTTP request.Parameter
Parameter next: The closure to invoke to cause the router to inspect the path in the list of paths.Declaration
Swift
public typealias RouterHandler = (RouterRequest, RouterResponse, @escaping () -> Void) throws -> Void
Parameters
request
The
RouterRequest
object that is used to work with the incoming request.response
The
RouterResponse
object used to send responses to the HTTP request.next
The closure to invoke to cause the router to inspect the path in the list of paths.
-
Undocumented
-
Type alias for written data filter, i.e. pre-write lifecycle handler.
Declaration
Swift
public typealias WrittenDataFilter = (Data) -> Data
-
Type alias for
Before flush
(i.e. before headers and body are written) lifecycle handler.Declaration
Swift
public typealias LifecycleHandler = () -> Void