src/middleware/router.js
function EvalRoute (ctx, next) {
	let router = this;
	let matched = router.match(router.opts.routerPath || ctx.routerPath || ctx.path, ctx.method);
	/* istanbul ignore else */
	if (ctx.matched) {
		ctx.matched.push.apply(ctx.matched, matched.path);
	} else {
		ctx.matched = matched.path;
	}
	if (matched.route) {
		return this.middleware()(ctx, next);
	} else {
		return Promise.resolve('koaton-no-route');
	}
}
function EvalRoute (ctx, next) {
	let router = this;
	let matched = router.match(router.opts.routerPath || ctx.routerPath || ctx.path, ctx.method);
	/* istanbul ignore else */
	if (ctx.matched) {
		ctx.matched.push.apply(ctx.matched, matched.path);
	} else {
		ctx.matched = matched.path;
	}
	if (matched.route) {
		return this.middleware()(ctx, next);
	} else {
		return Promise.resolve('koaton-no-route');
	}
}
function EvalRoute ( ctx , next ) { let router = this ; let matched = router . match ( router . opts . routerPath || ctx . routerPath || ctx . path , ctx . method ) ; /* istanbul ignore else */ if ( ctx . matched ) { ctx . matched . push . apply ( ctx . matched , matched . path ) ; } else { ctx . matched = matched . path ; } if ( matched . route ) { return this . middleware ( ) ( ctx , next ) ; } else { return Promise . resolve ( 'koaton-no-route' ) ; } }
Checks if the current route is valid matches with the given router
@private
@param {KoaContext} ctx
@param {KoaNext} next
@return {Object|String} if route does not math it will return 'koa-no-route'
Checks if the current route is valid matches with the given router