koajs / router

Router middleware for Koa. Maintained by @forwardemail and @ladjs.
MIT License
849 stars 174 forks source link

[feat] ctx's key of _matchedRoute #159

Open zhizhemodi opened 2 years ago

zhizhemodi commented 2 years ago

Hello!

When I changed from old version to this new version, I found that the ctx._matchedRoute no longer give the mostSpecoficLayer.path, but the old version code still exist, so I think if the ctx._matchedRoute in router.js line 403 can change to ctx._lastMatchedRoute then people can use the mostSpecificLayer.path again.

ctx._matchedRoute = mostSpecificLayer.path \\ router.js line 403 =>
ctx._lastMatchedRoute = mostSpecificLayer.path