Built-in middleware
CORS
Rate limiting
Logging
Timeout
Pipeline composition
Combine middleware into a pipeline:Route-specific middleware
Apply middleware only to matching URL patterns:Execute the pipeline
Cleanup callbacks
Register teardown logic that runs after the response is sent:Custom middleware
A middleware is a function that receives a context object and anext function. Access the request via c.request:
Next
- OAuth: add social login to your app
- API Routes: the routes that middleware protects
Related
veryfront/middleware: middleware API reference