packageVersion: string;
parameters: {};
protocol: string;
- remoteHosts: string;
+ remoteHosts: {
+ [key: string]: string
+ };
remoteHostsViaDNS: boolean;
resources: {};
revision: string;
.catch(() => Promise.resolve(getDefaultConfig()))
.then(config => Axios
.get<Config>(getDiscoveryURL(config.API_HOST))
- .then(response => ({
+ .then(response => ({
// TODO: After tests delete `|| '/vocabulary-example.json'`
- config: {...response.data, vocabularyUrl: config.VOCABULARY_URL || '/vocabulary-example.json' },
- apiHost: config.API_HOST,
+ // 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,
})));
};
packageVersion: '',
parameters: {},
protocol: '',
- remoteHosts: '',
+ remoteHosts: {},
remoteHostsViaDNS: false,
resources: {},
revision: '',
FILE_VIEWERS_CONFIG_URL: "",
});
-const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/discovery/v1/apis/arvados/v1/rest`;
+export const DISCOVERY_URL = 'discovery/v1/apis/arvados/v1/rest';
+const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${DISCOVERY_URL}`;