def middleware(self, func):
        """Register given middleware (v1)."""
        self.middlewares.append(web.middleware(to_coroutine(func)))
def middleware ( self , func ) : self . middlewares . append ( web . middleware ( to_coroutine ( func ) ) )
Register given middleware (v1).