Skip to content

Documentation / @ember-data/json-api / request / setBuildURLConfig

ts
function setBuildURLConfig(config): void;

Defined in: warp-drive-packages/utilities/declarations/-private/json-api/-utils.d.ts:54

Allows setting extensions and profiles to be used in the Accept header.

Extensions and profiles are keyed by their namespace with the value being their URI.

Example:

ts
setBuildURLConfig({
  extensions: {
    atomic: 'https://jsonapi.org/ext/atomic'
  },
  profiles: {
    pagination: 'https://jsonapi.org/profiles/ethanresnick/cursor-pagination'
  }
});

This also sets the global configuration for buildBaseURL for host and namespace values for the global coniguration done via import { setBuildURLConfig } from '@warp-drive/utilities';

These values may still be overridden by passing them to buildBaseURL directly.

This method may be called as many times as needed

ts
type BuildURLConfig = {
  host: string;
  namespace: string'
}

Parameters

config

JSONAPIConfig

Returns

void

Released under the MIT License.