Cborm, resthandler: How to define rest resources from a moduleconfig?

We have a rest handler which extends cborm.models.resources.BaseHandler (latest Coldbox, latest cbOrm)
If I add to config router:
resources(resource = 'api/user', handler = 'cbadmin:api.user',parameterName='userid');
This generates the following routes:

If I add to my cbadmin/ModuleConfig.cfc
function onLoad(){ appRouter.resources(resource = 'api/user', handler = 'api.user',module='cbadmin',parameterName='userid');
This generates the following module routes:

But if I call /cbadmin/api/user/1/edit/ then I get an 405 Invalid Action, because the RC looks like this:

Any ideas what I’m doing wrong?

Yes, you can see it from the image. Routes are discovered in order. So your routes will NEVER be executed because they are defined AFTER the convention routes in the module.

Screen Shot 2021-02-19 at 8.49.38 AM

Thanks Luis, I wasn’t aware that the moduleConfig configure method has a property resources.
This is missing in the documentation:

After adding there:
resources = [ {resource = 'api/user', handler = 'api.user',parameterName='userid'} ];
the routes are now in correct order and everything works as expected!