Network configuration
To use the network layer, you should check/update the following options:
baseUrl- The base path to the API. Default is"/", but could be something like"https://example.com/api/"- Model
endpoint- Path to the model type on the API. If not defined, it will use the model type. This can be used if the url needs to be prefixed (e.g. model scoping) or e.g. if the url is in plural, but the model type is in singular. Using the endpoint function allows you to override thebaseUrlin case some models need a different base URL. fetchReference- Set towindow.fetchby default, but can be set to some otherfetchimplementation, e.g.isomorphic-fetchdefaultFetchOptions- If needed, you can define default options that are passed to the fetch method. Keep in mind that the body and method properties will be overridden. By default, it is setting thecontent-typeheader according to the JSON API specification
If you want to use some other method of communication with the server (e.g. jQuery, superagent or axios), you can override the baseFetch method.
If you need to transform the request and response data dynamically (e.g. setting or getting API tokens/session tokens), you can use transformRequest and transformResponse.
For a detailed specification of the available options, check out the config options.