Now that nested routes have become a thing we need to make sure that middleware can also be nested and inherited from:
- top level
- proxy
- route
- nested route
this is going to most likely require the building of routes to be deferred by the SiteHub DSL to get this to work.
The code below is what I have started to scratch out for RouteBuilder#add_route
# TODO: test around inherited middleware
# TODO test around nested routes for resolve method. route collections don't use the id for nested route resolutions
# middleware = middlewares()
# instance = new(rule: rule, id: label) do
# middleware.each do |middleware_args_and_block|
# middleware_class, args, block2 = middleware_args_and_block
# use middleware_class, *args, &block2
# end
# instance_eval(&block)
# end
# instance.build
Now that nested routes have become a thing we need to make sure that middleware can also be nested and inherited from:
this is going to most likely require the building of routes to be deferred by the SiteHub DSL to get this to work.
The code below is what I have started to scratch out for
RouteBuilder#add_route