Multi-word custom API endpoint

Hi, I am trying to set up my own API endpoint by addon. I need to have a controller methods under some multi-word API path. My goal is to have endpoint like this:


where ‘get’ will be one of actions from my addon controller.

So in my addon bootstrap.php I added:

    $this->on('', function ($routes) {
        $routes['custom/collections'] = 'CustomAddon\\Modules\Collections\\Controller\\RestApi';

It not works. I have also tested with dot, full api path etc. And I also couldn’t find information about how I can do this. Maybe some of us know how can I hook full conroller methods under complex API path from addons or mabe from other way?