Middlewares
Middlewares are functions that execute sequentially before the handler or validator if presented.
If a middleware returns a Response
object, the object is returned as a response directly.
To skip checking this you can use app.prepare
with the same arguments instead of app.use
.
If a middleware returns a Promise
it should be an async function for the compiler to detect and inline the validator call.
To register middlewares for all handlers of a Byte
instance: