Added support for middleware array in routes.setup()