/Knowledge/sources/honojs__hono/llms-full/route-helper-matchedroutes--dc7157322687.md
Route Helper: matchedRoutes() - hono-docs
Route Helper: matchedRoutes() Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt matchedroutes Summary Re...
Route Helper: matchedRoutes()
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#matchedroutes
Summary
Returns an array of all routes that matched the current request, including middleware. ```ts app.all('/api/*', (c, next) => { console.log('API middleware') return next() }) app.get('/api/users/:id', (c) => { const routes = matchedRoutes(...
Content
Returns an array of all routes that matched the current request, including middleware.
app.all('/api/*', (c, next) => {
console.log('API middleware')
return next()
})
app.get('/api/users/:id', (c) => {
const routes = matchedRoutes(c)
// Returns: [
// { method: 'ALL', path: '/api/*', handler: [Function] },
// { method: 'GET', path: '/api/users/:id', handler: [Function] }
// ]
return c.json({ routes: routes.length })
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#matchedroutes",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Route Helper > `matchedRoutes()`",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 732,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Route Helper: matchedRoutes()",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}