2 * Copyright © 2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 import configData from './config.json';
20 return configData[key];
24 var prev = configData[key];
25 configData[key] = value;
29 setCatalogApiRoot(CatalogApiRoot) {
30 let restCatalogPrefix = CatalogApiRoot,
31 restPrefix = CatalogApiRoot.replace(
33 '/feProxy/onboarding-api'
36 this.set('restPrefix', restPrefix);
37 this.set('restCatalogPrefix', restCatalogPrefix);
40 setCatalogApiHeaders(CatalogApiHeaders) {
41 this.set('CatalogApiHeaders', CatalogApiHeaders);
43 let { userId: { value: UserID } = {} } = CatalogApiHeaders;
44 this.set('UserID', UserID);
48 const configuration = new Configuration();
50 (function setDefaultRestPrefixes(configuration) {
51 configuration.set('restPrefix', configuration.get('defaultRestPrefix'));
54 configuration.get('defaultRestCatalogPrefix')
57 'activitiesRestPrefix',
58 configuration.get('activitiesRestPrefix')
60 configuration.set('appContextPath', configuration.get('appContextPath'));
63 export default configuration;