We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
useRoute
1 parent 3354436 commit 5220bfcCopy full SHA for 5220bfc
src/plugins/factory/Router.js
@@ -3,12 +3,12 @@
3
const KoaRouter = require('koa-router');
4
5
class Router extends KoaRouter {
6
- useRoute(path, ...middlewares) {
+ useRoute(...middlewares) {
7
const subrouter = middlewares.pop();
8
if (subrouter instanceof KoaRouter) {
9
- this.use(path, ...middlewares, subrouter.routes(), subrouter.allowedMethods());
+ this.use(...middlewares, subrouter.routes(), subrouter.allowedMethods());
10
} else {
11
- this.use(path, ...middlewares, subrouter);
+ this.use(...middlewares, subrouter);
12
}
13
return this;
14
0 commit comments