emmett icon indicating copy to clipboard operation
emmett copied to clipboard

Introduce `AppModuleGroup`

Open gi0baro opened this issue 3 years ago • 0 comments

Useful for conditions where the same route should be routed on two different endpoints with different pipelines.

Usage should look like this:

mod1 = app.module(__name__, "mod1", url_prefix="v1")
mod2 = app.module(__name__, "mod2", url_prefix="v2")

mod1.pipeline = [SomePipe()]
mod2.pipeline = [SomeOtherPipe()]

gmod = app.module_group(mod1, mod2)

@gmod.route()
async def foo():
    ...

gi0baro avatar Jun 16 '22 08:06 gi0baro