Fetch layout data using a custom REST data fetcher
Version:
The JSS RestLayoutServiceConfig type accepts a dataFetcherResolver property. You can use this property to pass a custom data fetcher to your instance of the Layout Service. By default, the JSS REST Layout service uses the NativeDataFetcher.
To use a REST layout service with a custom data fetcher:
-
In a
layout-service.tsfile, create an instance of theRestLayoutServiceclass and provide the configuration object:-
For JSS version 22.4 or later, use
NativeDataFetcher: -
For JSS version 22.3 or earlier, use
AxiosDataFetcher:
-
-
Import and use the new layout service: