Three layers, because there are three: the application's own middleware, the kernel's, and the
router's, which is the only one that runs with a route matched and can therefore read what a route
declares. global: true keeps meaning the kernel, and layer wins when both are given, since
naming the layer is the more precise statement.
A middleware needing the matched route previously had nowhere to be declared from: both branches
led to the kernel, where nothing has been matched yet. Writing a key another module reads is how a
blueprint works, and how @AdapterMiddleware has always reached stone.adapter.middleware: an
unread key costs nothing when that module is absent.
Where a declared middleware belongs.
Three layers, because there are three: the application's own middleware, the kernel's, and the router's, which is the only one that runs with a route matched and can therefore read what a route declares.
global: truekeeps meaning the kernel, andlayerwins when both are given, since naming the layer is the more precise statement.A middleware needing the matched route previously had nowhere to be declared from: both branches led to the kernel, where nothing has been matched yet. Writing a key another module reads is how a blueprint works, and how
@AdapterMiddlewarehas always reachedstone.adapter.middleware: an unread key costs nothing when that module is absent.