What is the best way to debug routes and handlers?...
# box-products
r
What is the best way to debug routes and handlers? I tried to use route-visualizer but it does not show up when I add
/route-visualizer
to the URL after installing it with Commandbox CLI. Basically, would something like this work in Router.cfc?
Copy code
route(':action?').toHandler('admin')
.withCondition(function(event, rc, prc) {
	return isUserInRole('admin');
});

Essentially, I am attempting to simplify the URL from `/admin/action` to `/action` only.  Then, in the route, check if the user's role is 'admin' to accept the route and pass it to the Admin handler.  I've never used withCondition and the limited example is not quite correct in the coldbox docs, either, but I get the gist of it.
<https://coldbox.ortusbooks.com/the-basics/routing/routing-dsl/routing-methods#routing-conditions>