Does it make a difference if I create multiple routes with no matching criteria vs a single route?
E.g.
router.route().handler(BodyHandler.create())
router.route().handler(ResponseContentTypeHandler.create())
vs.
with(router.route()){
handler(BodyHandler.create())
handler(ResponseContentTypeHandler.create())
}
One difference I did notice is that the priority is enforced within the route, but not across the routes. So e.g. this will pass
router.route().handler(Handler<RoutingContext>{ .. })
router.route().handler(AutenticationHandler{ .. })
but this will fail:
with(router.route()){
handler(Handler<RoutingContext>{ .. })
handler(AutenticationHandler{ .. })
}
Per the javadoc:
You should add multiple handlers to the same route object rather than creating two different routes objects with one handler for route
but what is the worst thing that would happen if I create different routes?