/Knowledge/sources/honojs__hono/llms-full/timeout-middleware-usage--21e1d50ecd07.md
Timeout Middleware: Usage - hono-docs
Timeout Middleware: Usage Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt usage Summary Here's how to...
Timeout Middleware: Usage
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#usage
Summary
Here's how to use the Timeout Middleware with both default and custom settings: Default Settings: ```ts const app = new Hono() // Applying a 5-second timeout app.use('/api', timeout(5000)) // Handling a route app.get('/api/data', async (...
Content
Here's how to use the Timeout Middleware with both default and custom settings:
Default Settings:
const app = new Hono()
// Applying a 5-second timeout
app.use('/api', timeout(5000))
// Handling a route
app.get('/api/data', async (c) => {
// Your route handler logic
return c.json({ data: 'Your data here' })
})
Custom settings:
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#usage",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Timeout Middleware > Usage (1)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 349,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Timeout Middleware: Usage",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}