/Knowledge/sources/honojs__hono/llms-full/middleware-context-access-inside-middleware-arguments--601fb38fb295.md
Middleware: Context access inside Middleware arguments - hono-docs
Middleware: Context access inside Middleware arguments Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt...
Middleware: Context access inside Middleware arguments
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#context-access-inside-middleware-arguments
Summary
To access the context inside middleware arguments, directly use the context parameter provided by app.use. See the example below for clarification. ```ts import { cors } from 'hono/cors' app.use('*', async (c, next) => { const middlewa...
Content
To access the context inside middleware arguments, directly use the context parameter provided by app.use. See the example below for clarification.
import { cors } from 'hono/cors'
app.use('*', async (c, next) => {
const middleware = cors({
origin: c.env.CORS_ORIGIN,
})
return middleware(c, next)
})
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#context-access-inside-middleware-arguments",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Middleware > Context access inside Middleware arguments",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 117,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Middleware: Context access inside Middleware arguments",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}