You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if that is already supported and I just don't see it. I want to "dynamically" mount a koa app with routes to a variable route like this:
constappRouter=()=>{returnnewRouter().use(ctx=>{// has ctx.params.app// has ctx.params.id if its specified in the route,}).get("/:id",ctx=>{// has ctx.params.app// has ctx.params.id,}).middleware()app.use(mount("/:app",appRouter()))
Which should enable routes like:
/myapp/1 /myapp/2
Even better if I could design the approuter to be totally unaware of the /:app part of the route and only would have to deal with its own routes. Then I would like to move the processing of potential id params to a middleware that is called before the approuter and sets some infos in the ctx before passing control to the approuter.
The text was updated successfully, but these errors were encountered:
I am not sure if that is already supported and I just don't see it. I want to "dynamically" mount a koa app with routes to a variable route like this:
Which should enable routes like:
/myapp/1
/myapp/2
Even better if I could design the approuter to be totally unaware of the
/:app
part of the route and only would have to deal with its own routes. Then I would like to move the processing of potentialid
params to a middleware that is called before the approuter and sets some infos in thectx
before passing control to the approuter.The text was updated successfully, but these errors were encountered: