If you're setting the URL on your store proxies via Ext.data.proxy.Ajax.url, you could do this in one of two ways.
One: you can extend (or override) the class, adding the logic yourself.
Two: you could configure your URLs as such:
//someplace define this...
var urlPrefix = function() {
return '/path/to/API/';
};
//in your store/proxy
Ext.define('MyApp.store.Foo', {
config : {
proxy : {
type : 'ajax',
url : urlPrefix() + 'API_endpoint'
}
}
});
I've done that a bunch of times before.
As for your Auth headers, you can override Ext.data.Connection to include additional headers. The key here is that you would need to override it very early in the application lifetime, because other classes have unique instances of Ext.data.Connection (for example, Ext.Ajax).
But before giving a recommendation on how to apply the headers globally, I'd need to know more about what you needed to do. There's many things to consider before doing that.