Mount Controllers with Routing Namespace #14
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Right now all of the route controllers are mounted at the top-level "/" route, so all of their routes need to define their full route. e.g.
/api/v1/result/list
. Ideally each controller should be mounted in its own namespace and their routes defined relative to their mount.I don't know if this is possible with Sinatra, but would improve readability IMO.
Unfortunately, the
map
method that AI recommended is meant to be put in theconfig.ru
file. This solution might work, but would make testing a bit more wonky. I'll want to see what other impact that change might have before making that change.Another option could be to define a route prefix in each controller and make the routes concatenate that variable:
Only issue with this is it would mean EVERY ROUTE would need to compute/concatenate their route, instead of just using a static string.