Commit 5ff0784d authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Some refactoring

parent dd8c6f73
Pipeline #27502 passed with stages
in 6 seconds
......@@ -421,23 +421,29 @@
const IMAGE_DIR= 'img/';
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/'; // my local dev environment
// API URL and user cookie domain configuration
// Case 1: my local dev environment
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/';
let USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('nomad-coe.eu') > 0){// production environment
let path = 'v1.0/';
// Case 2: production environment
if (document.location.href.indexOf('nomad-coe.eu') > 0){//
API_HOST='https://encyclopedia.nomad-coe.eu/';// old host -> API_HOST= 'https://encyclopedia-api.nomad-coe.eu/'; //***
USER_COOKIE_DOMAIN = '.nomad-coe.eu';
path = 'api/v1.0/';
}
// testing-staging environment and local installations (docker containers) of full Encyclopedia stack
// Case 3: testing-staging environment and local installations (docker containers) of full Encyclopedia stack
else if (document.location.href.indexOf('gui') > 0){
API_HOST= '/'; // USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('staging-nomad') > 0) // testing-staging online server
API_HOST= '/'; // USER_COOKIE_DOMAIN = 'localhost' and path = 'v1.0/';
if (document.location.href.indexOf('staging') > 0) // testing-staging server
USER_COOKIE_DOMAIN = '.mpg.de';
}
let API_BASE_URL = API_HOST + path;// for the old host -> API_HOST+'v1.0/';
console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);
let API_BASE_URL = API_HOST+'v1.0/';// for the old host -> API_HOST+'v1.0/';
if (document.location.href.indexOf('nomad-coe.eu') > 0)
API_BASE_URL = API_HOST+'api/v1.0/';
document.querySelector('#guest-user a').href = API_BASE_URL+'saml/?sso2';
......
......@@ -10,23 +10,29 @@ let searchResults = false;
const IMAGE_DIR= 'img/';
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/'; // my local dev environment
// API URL and user cookie domain configuration
// Case 1: my local dev environment
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de/';
let USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('nomad-coe.eu') > 0){// production environment
let path = 'v1.0/';
// Case 2: production environment
if (document.location.href.indexOf('nomad-coe.eu') > 0){//
API_HOST='https://encyclopedia.nomad-coe.eu/';// old host -> API_HOST= 'https://encyclopedia-api.nomad-coe.eu/'; //***
USER_COOKIE_DOMAIN = '.nomad-coe.eu';
path = 'api/v1.0/';
}
// testing-staging environment and local installations (docker containers) of full Encyclopedia stack
// Case 3: testing-staging environment and local installations (docker containers) of full Encyclopedia stack
else if (document.location.href.indexOf('gui') > 0){
API_HOST= '/'; // USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('staging-nomad') > 0) // testing-staging online server
API_HOST= '/'; // USER_COOKIE_DOMAIN = 'localhost' and path = 'v1.0/';
if (document.location.href.indexOf('staging') > 0) // testing-staging server
USER_COOKIE_DOMAIN = '.mpg.de';
}
let API_BASE_URL = API_HOST + path;// for the old host -> API_HOST+'v1.0/';
console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);
let API_BASE_URL = API_HOST+'v1.0/';// for the old host -> API_HOST+'v1.0/';
if (document.location.href.indexOf('nomad-coe.eu') > 0)
API_BASE_URL = API_HOST+'api/v1.0/';
document.querySelector('#guest-user a').href = API_BASE_URL+'saml/?sso2';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment