Combining middleware — Middleware · Hono

Build one guard out of several with the combinators in hono/combine: accept either of two credentials with some(), require several checks with every(), and carve out public routes with except().

What you will learn

Read the theory for Combining middleware

All Middleware lessons

All Hono courses

loading types…

What you'll learn

  • Accept a bearer token or basic credentials on the same routes with some(), and know whose challenge a refused request sees
  • Chain checks that must all pass with every(), in order
  • Exclude paths from a guard with except(), by pattern or by a function of the context