Invoke on this router once all routes are added.
If you are using the default router from RequestSink, this method is called for you. Otherwise, you must call this method after all routes have been added to build a tree of routes for optimized route finding.
Source
void finalize() { _rootRouteNode = new RouteNode(_routeControllers.expand((rh) => rh.patterns).toList()); }