I would not really agree with that. I am not saying you should use yoke. I want to say that vert.x is supposed to be as simple as possible but not too simple. It does all the simple things it was designed to do, such as web servers that can in a high level handle all http verbs using the route matcher and this is good enough for say most of the folks using vert.x but for more complex examples you need to use the handler directly and do your stuff.
If you start requesting the route matcher to allow point cuts in its execution and triggering events before, after any action, then the complexity of the route matcher increases in a way that it may become not that useful for most folks.
This was the reason i had to start yoke. I saw the power of the base code and saw that it could be possible that some people need more than the route matcher. In this case and after fighting with the problem myself I got quite happy with the current implementation of yoke.
I think that if you do not want dependencies is fine (i am fond of that too) but i can also say that creating a class that can run before the route matcher is also a no brainer, start by extending the router matcher and override the handle(HttpServerRequest) method and call you stuff before...
I think that the extension would be the easiest and minimal code you would need to maintain, something like:
var server = vertx.createHttpServer();
var routeMatcher = new vertx.RouteMatcher();
// keep a ref to the original function
var handlerFn = rm.handle;
rm.handle = function (req) {
// do the authentication step...
...
// delegate again on the original function
handlerFn.apply(rm, req);
}
server.requestHandler(routeMatcher).listen(8080, 'localhost');
note that i might have the JS API wrong (since i am typing out of my head from the java API.