Multiple domains for different ressources ? overriden httpconfig
Hi, Wondering how to manage multiple httpConfig for different ressource (eg: setting different domain url for different ressource ), I ended up working with two adapters, which I believe was the right way to achieve it.
But I was surprised httpConfig was overridden by registering two http adapters.
Repro: https://jsfiddle.net/alexandreBonaventure/9ue6v6qy/6/
Is there an another to achieve this, any workaround ?
Instead of using httpConfig#baseURL, I would recommend the following:
store.registerAdapter('http2', new DSHttpAdapter({
basePath: `host1/api`
}))
store.registerAdapter('http', new DSHttpAdapter({
basePath: `host2/api`
}), { default: true });
@jmdobry i am trying to do the same and do it exactly as you mention above... my issue is that one API requires an auth token in the headers and the other doesn't. however- both adapters are sharing the httpConfig defaults. This is sending the apiKey to both adapters and one doesn't allow that header key which results in an error. Any recommendations?