 
 ///
 /// Type alias for "Before flush" (i.e. before headers and body are written) lifecycle handler
-public typealias PreFlushLifecycleHandler = (request: RouterRequest, response: RouterResponse) -> Void
+public typealias LifecycleHandler = () -> Void

    /// Sets the pre-flush lifecycle handler and returns the previous one
    ///
    /// - Parameter newPreFlush: The new pre-flush lifecycle handler
    public func setPreFlushHandler(_ newPreFlush: PreFlushLifecycleHandler) -> PreFlushLifecycleHandler {
        let oldPreFlush = preFlush
        preFlush = newPreFlush
        return oldPreFlush
    }



    ///
    public func end() throws {

        onEndInvoked()
        
        // Sets status code if unset
        if statusCode == .unknown {
