Skip to content

Add ability to prepend middleware

Compare
Choose a tag to compare
@VaporBot VaporBot released this 12 Jul 13:52
· 257 commits to main since this release
f6a422c
This patch was authored by @jaredh159 and released by @0xTim.

Allows middleware to be inserted at the start of the responder chain. This is useful when working with things like the CORSMiddleware.

Usage:

app.middleware.use(corsMiddleware, at: .beginning)

The default behaviour remains appending:

app.middleware.use(someOtherMiddleware)