async main(ctx) {
        // filter the routes matching the request
        const matches = this.routes.filter((route) => ctx.request.url.toLowerCase() === url_1.parse(route.path).path.toLowerCase() &&
            (route.method === null || ctx.request.method.toUpperCase() === route.method.toUpperCase()));
        // merge the handlers of the matched routes
        const merged = [];
        for (const match of matches)
            for (const handler of match.handlers)
                merged.push(handler);
        // handle the request using the 'handlers'
        await this._handleNext(ctx, merged);
        // reset i
        this.i = -1;
    }
/**
     * Filters routes by the requests method and URL, then fires thier respective handlers.
     *
     * @param ctx The Context
     */
Filters routes by the requests method and URL, then fires thier respective handlers.
@param ctx The Context
Filters routes by the requests method and URL then fires thier respective handlers . @param ctx The Context
async main(ctx) {
        const matches = this.routes.filter((route) => ctx.request.url.toLowerCase() === url_1.parse(route.path).path.toLowerCase() &&
            (route.method === null || ctx.request.method.toUpperCase() === route.method.toUpperCase()));
        const merged = [];
        for (const match of matches)
            for (const handler of match.handlers)
                merged.push(handler);
        await this._handleNext(ctx, merged);
        this.i = -1;
    }
async main ( ctx ) { const matches = this . routes . filter ( ( route ) => ctx . request . url . toLowerCase ( ) === url_1 . parse ( route . path ) . path . toLowerCase ( ) && ( route . method === null || ctx . request . method . toUpperCase ( ) === route . method . toUpperCase ( ) ) ) ; const merged = [ ] ; for ( const match of matches ) for ( const handler of match . handlers ) merged . push ( handler ) ; await this . _handleNext ( ctx , merged ) ; this . i = - 1 ; }
Filters routes by the requests method and URL, then fires thier respective handlers.
Filters routes by the requests method and URL then fires thier respective handlers .
// filter the routes matching the request // merge the handlers of the matched routes // handle the request using the 'handlers' // reset i