Skip to content

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

ts
function setBuildURLConfig(config): void;

Defined in: -private/builders/-utils.ts:61

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 application in the @ember-data/request-utils package.

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.