Changed default back to 'routes'.
Added support for middlewares, as shown in the example.