add method
Add handler
for verb
requests to route
.
If verb
is GET
the handler
will also be called for HEAD
requests
matching route
. This is because handling GET
requests without handling
HEAD
is always wrong. To explicitely implement a HEAD
handler it must
be registered before the GET
handler.
Implementation
void add(String verb, String route, Function handler,
[Middleware? localMiddleware]) {
shelfRouter.add(
verb,
route,
_RouterPlusHandler(handler, [
..._middlewareList,
if (localMiddleware != null) localMiddleware,
]).call);
_routeAdded = true;
}