I think Brad described this best:
addRoute(pattern="api/:handler/:action",viewNoLayout="true",package="site/APIHandlers");
And then the URL:
mysite.com/api/user/edit
would map to the following handler?
/handlers/site/APIHandlers/user
This would effectively allow us to do things like:
addRoute(pattern="api/:handler/:action",viewNoLayout="true",package="site/api/v1/"); Note the '/v1/' in the path/package.
More specifically, there should be no confusion between "/handler/roles.cfc" and "/handlers/site/api/v1/roles.cfc" because I told the route where to go path/package wise.
implemented via with routing closures
Can you confirm that ? You suggested closures in the original forum thread but the OP said that didn't solve the problem. Perhaps you can include sample code that does what this ticket is asking for using that feature.
Ok, I get it know. It is just prepending the virtual :handler portion.
I don't know about a use case for this that is so impactful. Anyways, I will re open so we can evaulate it as we will redeisng our routing API
A possible use case would be a large number of handlers in a "deep" package, but you want to shorten the SES route for all of them without manually creating a route for each handler. Or perhaps to repoint an entire API from /v1/ to /v2/ behind the scenes with a single line.
This is going to be resolved using the new routing DSL and group closures.