Skip to main content
The Hono middleware works the same way as Express but uses Hono’s middleware API.

Basic setup

App-level middleware

Multiple payment methods

Same configuration as Express — pass multiple requirements to the accepts array:

Differences from Express

The core logic is identical. The only difference is the middleware signature:
  • Express: (req, res, next) => void
  • Hono: (c, next) => Promise<void>
The createMiddleware function from @faremeter/middleware/hono returns a Hono-compatible middleware. Configuration, payment requirements, and facilitator interaction are the same.

Further reading