How do I override an endpoint provided by a module in a feature? I am using the Services module and Drupalgap, which provides a service endpoint by default.  I want to make changes to the available services on the drupalgap endpoint, and I manage configuration on my site using Features, so I want to override the endpoint provided by Drupalgap.

However, if I check the box in the Features UI, it doesn't add the drupalgap endpoint because it's already "owned" by the Drupalgap module.

I dug into the code and the Drupalgap endpoint is provided by drupalgap_default_services_endpoint().  I tried adding the exported service configuration in mymodule_drupalgap_default_services_endpoint() and clearing the cache but it doesn't look like this gets picked up.

So, how can I override a service endpoint in a module's code with my own code for that endpoint?  If there's no way to do it, I guess I can cut and paste the exported, updated code over the endpoint in the Drupalgap module, but that seems like the wrong approach.
I found a smooth way to do this without overriding anything.


Create a new services endpoint by cloning the Drupalgap endpoint.
Add the new endpoint to a feature to keep it in code.
In Drupalgap's settings.js, change the endpoint to the new custom endpoint. The relevant line is:

// Default Services Endpoint Path

Drupal.settings.endpoint = 'drupalgap';