For now, router only dispatch a given request to a given route.
Maybe we should implement a middleware system (or filter system).
Basicaly it's a piece of code that executes before the controller code and can handle things like authentification and XCSRF protection.
Also I'm not sure how we can make a fluent syntax with the decorator. Something like @Middleware is possible but can become tedious and clutered very fast.
Basicaly the goal is to replace parts of the actual Router.dispatch() method with middlewares.
It's also important because express provide this functionnality out of the box (also Laravel and Zend does too)
For now, router only dispatch a given request to a given route.
Maybe we should implement a middleware system (or filter system).
Basicaly it's a piece of code that executes before the controller code and can handle things like authentification and XCSRF protection.
Also I'm not sure how we can make a fluent syntax with the decorator. Something like @Middleware is possible but can become tedious and clutered very fast.
Basicaly the goal is to replace parts of the actual Router.dispatch() method with middlewares. It's also important because express provide this functionnality out of the box (also Laravel and Zend does too)