- .then(config => Axios.get<Config>(getDiscoveryURL(config.API_HOST)))
- .then(response => response.data);
+ .then(config => Axios
+ .get<Config>(getDiscoveryURL(config.API_HOST))
+ .then(response => ({
+ // TODO: After tests delete `|| '/vocabulary-example.json'`
+ // TODO: After tests delete `|| '/file-viewers-example.json'`
+ config: {
+ ...response.data,
+ vocabularyUrl: config.VOCABULARY_URL || '/vocabulary-example.json',
+ fileViewersConfigUrl: config.FILE_VIEWERS_CONFIG_URL || '/file-viewers-example.json'
+ },
+ apiHost: config.API_HOST,
+ })));
+