Middleware
Middleware behaves the same as middlewares in traditional web frameworks. It wraps around the next middleware or handler, access the request data, modify or alter the response data. The middleware ordering in the stack is first in last out.
To declare a middleware, use declare middleware
.
Middleware implementation
To implement custom handlers, use server APIs. See:
- Namespace REFERENCE
- handler::Group REFERENCE
- Request REFERENCE
- Response REFERENCE
Installation
Middlewares can be applied to namespaces, while the middlewares stack inherit items from the parent namespace, too.
This code snippet demostrates how to install middlewares to a namespace's middleware stack.