I'm writing my first ColdBox driven API and I've s...
# box-products
r
I'm writing my first ColdBox driven API and I've started a new ColdBox app with
coldbox create app myApp rest-hmvc
and it's created the endpoints as
/api/v1/echo/
but with my app I want it to present as
/v1/echo/
but keep the
/modules_app/api/modules_app/v1/handlers/Echo.cfc
structure in the OS. I'm struggling to get the
/api/
out of the
/api/v1/
route. What am I missing?
I've never been good with getting my head around routing with Modules.
s
Add in top/app level /config/Router.cfc ... redirect all requested URI to module
route("/v1/").toModuleRouting( "/api/" );
https://coldbox.ortusbooks.com/the-basics/routing/routing-dsl#terminators
r
Thanks, a slight variation seems to work for me. In
/config/Router.cfc
route( '/v1' ).toModuleRouting( 'v1' );