/Knowledge/sources/honojs__hono/llms-full/route-helper-basepath--3646b25611e2.md
Route Helper: basePath() - hono-docs
Route Helper: basePath() Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt basepath Summary Returns the...
Route Helper: basePath()
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#basepath
Summary
Returns the base path with embedded parameters from the actual request. ```ts const subApp = new Hono() subApp.get('/posts/:id', (c) => { return c.text(basePath(c)) // '/api' (for request to '/api/posts/123') }) app.route('/:sub', subApp...
Content
Returns the base path with embedded parameters from the actual request.
const subApp = new Hono()
subApp.get('/posts/:id', (c) => {
return c.text(basePath(c)) // '/api' (for request to '/api/posts/123')
})
app.route('/:sub', subApp)
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#basepath",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Route Helper > `basePath()`",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 737,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Route Helper: basePath()",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}