/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-context-access-insi-13462583ab34-context-access-inside-middleware-arguments-s0117-c0000.md
Context access inside Middleware arguments - hono-docs
Context access inside Middleware arguments Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt contex...
Context access inside Middleware arguments
Source evidence: /Sources/raw/honojshono/honojshono.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)
})