Run middleware before all routes
Closed this issue · 1 comments
christianmalek commented
Hi,
I want to prepare the body for all routes before the route controller got instantiated and to do it only once I want to do this with your middleware. Is it possible to execute it for every route?
I tried following code but *
is an invalid routing pattern.
\Middleware::instance()->before("*", function (\Base $f3) {
echo "Middleware test";
return;
});
christianmalek commented
I found the errors...
- I forgot to
run()
the middleware "POST|PUT *"
did the trick.