code: function getObj(obj) {
      return function(name) {
        // koa-router 3.x return x.router.name;
        // koa-router 4.x return x.name;
        // koa-router 5.x return x.path[i].name;
        name = name || (
          router.match(this.path).path ?
            router.match(this.path).path[0].name :
            (router.match(this.path)[0].name || router.match(this.path)[0].route.name)
          );
        return ow[obj][name.toLowerCase()];
      };
    }
docs: app.use(router.routes()); app.use(router.allowedMethods());