Skip to content

Inherited middleware #7

Description

@lashd

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions