ea9701dbd5
`rpc` is used to define how to make a HTTP request/response messages. This used to be called 'request' but the term is overused and sounded like only one leg of the message, so the naming was moved to `rpc` a while ago, this cleans up the places where we still used the old term.
20 lines
527 B
JavaScript
20 lines
527 B
JavaScript
import Adapter from './http';
|
|
import { inject as service } from '@ember/service';
|
|
|
|
export const DATACENTER_QUERY_PARAM = 'dc';
|
|
export const NSPACE_QUERY_PARAM = 'ns';
|
|
export default Adapter.extend({
|
|
client: service('client/http'),
|
|
env: service('env'),
|
|
formatNspace: function(nspace) {
|
|
if (this.env.env('CONSUL_NSPACES_ENABLED')) {
|
|
return nspace !== '' ? { [NSPACE_QUERY_PARAM]: nspace } : undefined;
|
|
}
|
|
},
|
|
formatDatacenter: function(dc) {
|
|
return {
|
|
[DATACENTER_QUERY_PARAM]: dc,
|
|
};
|
|
},
|
|
});
|