Connect middleware wrapper for testable