Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add support for subrouters #2

Open
YourTechBud opened this issue Jun 17, 2023 · 0 comments
Open

[Feature] Add support for subrouters #2

YourTechBud opened this issue Jun 17, 2023 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@YourTechBud
Copy link
Contributor

The problem faced currently?

Different groups handlers often use different plugins. We have no way to configure plugins for just a subset of handlers registered in a worker.

How can we solve it?

We want something like this:

        router.Use(middleware2, middleware3)
        router.Use(middleware1)
        router.Route(func(subrouter *server.Router){
                subrouter.Query("query1")
                subrouter.With(middleware5).Mutation("query2")

                // Use can be called after Query, Mutation
                subrouter.Use(middleware4)
        })

        router.Query("query3")

        // In this example the following middlewares should be applied to each query in specified order
        // query1 -> 2, 3, 1, 4
        // query2 -> 2, 3, 1, 4, 5
        // query3 -> 2, 3, 1

If you want this feature to be implemented, give it a thumbs up reaction, so that we can determine which features are important to you.
👍

@YourTechBud YourTechBud added the enhancement New feature or request label Jun 17, 2023
@YourTechBud YourTechBud added this to the v0.1.0 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant