/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-routepath-adb07e148add-routepath-s0584-c0000.md
routePath - hono-docs
routePath Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt routepath Summary ::: warning Deprecate...
routePath
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#routepath
Summary
::: warning Deprecated in v4.8.0: This property is deprecated. Use routePath() from Route Helper instead. ::: You can retrieve the registered path within the handler like this: ```ts twoslash import { Hono }...
Content
::: warning
Deprecated in v4.8.0: This property is deprecated. Use routePath() from Route Helper instead.
:::
You can retrieve the registered path within the handler like this:
import { Hono } from 'hono'
const app = new Hono()
// ---cut---
app.get('/posts/:id', (c) => {
return c.json({ path: c.req.routePath })
})If you access /posts/123, it will return /posts/:id:
{ "path": "/posts/:id" }