/Knowledge/sources/honojs__hono/llms-full/middleware-built-in-middleware--7c94069c9499.md
Middleware: Built-in Middleware - hono-docs
Middleware: Built in Middleware Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt built in middleware Su...
Middleware: Built-in Middleware
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#built-in-middleware
Summary
Hono has built-in middleware. ```ts import { Hono } from 'hono' import { poweredBy } from 'hono/powered-by' import { logger } from 'hono/logger' import { basicAuth } from 'hono/basic-auth' const app = new Hono() app.use(poweredBy()) app....
Content
Hono has built-in middleware.
import { Hono } from 'hono'
import { poweredBy } from 'hono/powered-by'
import { logger } from 'hono/logger'
import { basicAuth } from 'hono/basic-auth'
const app = new Hono()
app.use(poweredBy())
app.use(logger())
app.use(
'/auth/*',
basicAuth({
username: 'hono',
password: 'acoolproject',
})
)
::: warning In Deno, it is possible to use a different version of middleware than the Hono version, but this can lead to bugs. For example, this code is not working because the version is different.
import { Hono } from 'jsr:@hono/hono@4.4.0'
import { upgradeWebSocket } from 'jsr:@hono/hono@4.4.5/deno'
const app = new Hono()
app.get(
'/ws',
upgradeWebSocket(() => ({
// ...
}))
)
:::
Metadata
{
"chunk_index": 0,
"citation": "https://hono.dev/llms-full.txt#built-in-middleware",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / Middleware > Built-in Middleware",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 114,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "Middleware: Built-in Middleware",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}