We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
背景: OPTL/koa就是接入koa项目,是正常的。 换成midway,会丢失router信息。
定位: OPTL/koa是根据中间件的取值context._matchedRoute为空。
期望: 能和koa中间件一样,是不是可以使用use去启动koa-router
The text was updated successfully, but these errors were encountered:
@czy88840616 你好,这个问题,我尝试使用了wrap useMiddleware去解决了,最终可以拿到_matchedRoute. 之前有同学说直接使用http的URL,不用管上层的router。但是会带来指标的多维度问题。比如:/a/123, /a/234, 会被记作不一样的label,而使用router就只有一个:/a/:id
Sorry, something went wrong.
给需要的朋友补充下 midway 如何拿到匹配路由:
const routeInfo = await this.webRouterService.getMatchedRouterInfo(ctx.path, ctx.method) console.log(routeInfo.fullUrl)
docs-当前匹配的路由
No branches or pull requests
背景:
OPTL/koa就是接入koa项目,是正常的。
换成midway,会丢失router信息。
定位:
OPTL/koa是根据中间件的取值context._matchedRoute为空。
期望:
能和koa中间件一样,是不是可以使用use去启动koa-router
The text was updated successfully, but these errors were encountered: