/Knowledge/sources/honojs__hono/llms-full/routing-routing-priority--part-02--6f99b24026cc.md
Routing: Routing priority (part 02) - hono-docs
Routing: Routing priority (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt routing priority S...
Routing: Routing priority (part 02)
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#routing-priority
Summary
If you want to have a "fallback" handler, write the code below the other handler. ```ts twoslash import { Hono } from 'hono' const app = new Hono() // ---cut--- app.get('/bar', (c) => c.text('bar')) // bar app.get('*', (c) => c.text('f...
Content
If you want to have a "fallback" handler, write the code below the other handler.
import { Hono } from 'hono'
const app = new Hono()
// ---cut---
app.get('/bar', (c) => c.text('bar')) // bar
app.get('*', (c) => c.text('fallback')) // fallback
GET /bar ---> `bar`
GET /foo ---> `fallback`
Metadata
{
"chunk_index": 1,
"citation": "https://hono.dev/llms-full.txt#routing-priority",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Routing > Routing priority (2)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 603,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Routing: Routing priority (part 02)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}