Commit 2577e18a authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Change the domains of the API hosts and the URLs (testing and production)

parent 08927732
Pipeline #27452 passed with stages
in 6 seconds
......@@ -109,14 +109,14 @@ logoutButton.addEventListener("click",function(e){document.cookie='user_info=; e
});
*//***/},/* 1 *//***/function(module,exports,__webpack_require__){"use strict";var DataStore=__webpack_require__(2);//let LoadingPopup = require('./LoadingPopup.js');
// global state vars
var materialId=null;var searchResults=false;var IMAGE_DIR='img/';var API_HOST='http://enc-testing-nomad.esc.rzg.mpg.de/';// my local dev environment
var materialId=null;var searchResults=false;var IMAGE_DIR='img/';var API_HOST='http://enc-staging-nomad.esc.rzg.mpg.de';// my local dev environment
var USER_COOKIE_DOMAIN='localhost';if(document.location.href.indexOf('nomad-coe.eu')>0){// production environment
API_HOST='https://encyclopedia-api.nomad-coe.eu/';USER_COOKIE_DOMAIN='.nomad-coe.eu';}// testing environment and local installations (docker containers) of full Encyclopedia stack
API_HOST='https://encyclopedia.nomad-coe.eu/';// old host -> API_HOST= 'https://encyclopedia-api.nomad-coe.eu/'; //***
USER_COOKIE_DOMAIN='.nomad-coe.eu';}// 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('testing-nomad')>0)// testing online server
USER_COOKIE_DOMAIN='.mpg.de';}console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);var API_BASE_URL=API_HOST+'v1.0/';document.querySelector('#guest-user a').href=API_BASE_URL+'saml/?sso2';var AUTH_REQUEST_HEADER_GUEST_USER='Basic '+//btoa('eyJhbGciOiJIUzI1NiIsImV4cCI6MTUyMzk2MTM5MSwiaWF0IjoxNTIzODc0OTkxfQ.ey'+
//'JpZCI6ImdodWhzIn0.9jYbcdOpjT9vWqvqE1Xm1p1vrjpQRKKEzuKGXx6orEs:');
btoa('eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4:');// Mockup URLs
if(document.location.href.indexOf('staging-nomad')>0)// testing-staging online server
USER_COOKIE_DOMAIN='.mpg.de';}console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);var API_BASE_URL=API_HOST+'api/v1.0/';// for the old host -> API_HOST+'v1.0/';
document.querySelector('#guest-user a').href=API_BASE_URL+'saml/?sso2';var AUTH_REQUEST_HEADER_GUEST_USER='Basic '+btoa('eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4:');// Mockup URLs
//const FERMI_SURFACE_URL= HOST+'files/fermi/'+
//'fed3fa9fbc68aa6c5e51845396889666ca37bb2e626e1da53.x3d';
var BAND_STRUCT_EXAMPLE_URL=API_BASE_URL+'materials/108541/calculations/290737';var MAT_VIEW={'structure':'structure','electronicstruct':'electronicstruct','methodology':'methodology','thermalprops':'thermalprops','elasticconst':'elasticconst'};var ELEMENTS=['H','He','Li','Be','B','C','N','O','F','Ne','Na','Mg','Al','Si',// Si = 14
......
......@@ -421,27 +421,25 @@
const IMAGE_DIR= 'img/';
let API_HOST= 'http://enc-testing-nomad.esc.rzg.mpg.de/'; // my local dev environment
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de'; // my local dev environment
let USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('nomad-coe.eu') > 0){// production environment
API_HOST= 'https://encyclopedia-api.nomad-coe.eu/';
API_HOST='https://encyclopedia.nomad-coe.eu/';// old host -> API_HOST= 'https://encyclopedia-api.nomad-coe.eu/'; //***
USER_COOKIE_DOMAIN = '.nomad-coe.eu';
}
// testing environment and local installations (docker containers) of full Encyclopedia stack
// 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('testing-nomad') > 0) // testing online server
if (document.location.href.indexOf('staging-nomad') > 0) // testing-staging online server
USER_COOKIE_DOMAIN = '.mpg.de';
}
console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);
const API_BASE_URL= API_HOST+'v1.0/';
const API_BASE_URL= API_HOST+'api/v1.0/';// for the old host -> API_HOST+'v1.0/';
document.querySelector('#guest-user a').href = API_BASE_URL+'saml/?sso2';
const AUTH_REQUEST_HEADER_GUEST_USER = 'Basic '+
//btoa('eyJhbGciOiJIUzI1NiIsImV4cCI6MTUyMzk2MTM5MSwiaWF0IjoxNTIzODc0OTkxfQ.ey'+
//'JpZCI6ImdodWhzIn0.9jYbcdOpjT9vWqvqE1Xm1p1vrjpQRKKEzuKGXx6orEs:');
btoa('eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+
'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4:');
......
......@@ -10,27 +10,25 @@ let searchResults = false;
const IMAGE_DIR= 'img/';
let API_HOST= 'http://enc-testing-nomad.esc.rzg.mpg.de/'; // my local dev environment
let API_HOST= 'http://enc-staging-nomad.esc.rzg.mpg.de'; // my local dev environment
let USER_COOKIE_DOMAIN = 'localhost';
if (document.location.href.indexOf('nomad-coe.eu') > 0){// production environment
API_HOST= 'https://encyclopedia-api.nomad-coe.eu/';
API_HOST='https://encyclopedia.nomad-coe.eu/';// old host -> API_HOST= 'https://encyclopedia-api.nomad-coe.eu/'; //***
USER_COOKIE_DOMAIN = '.nomad-coe.eu';
}
// testing environment and local installations (docker containers) of full Encyclopedia stack
// 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('testing-nomad') > 0) // testing online server
if (document.location.href.indexOf('staging-nomad') > 0) // testing-staging online server
USER_COOKIE_DOMAIN = '.mpg.de';
}
console.log('API host: ',API_HOST,' USER_COOKIE_DOMAIN: ',USER_COOKIE_DOMAIN);
const API_BASE_URL= API_HOST+'v1.0/';
const API_BASE_URL= API_HOST+'api/v1.0/';// for the old host -> API_HOST+'v1.0/';
document.querySelector('#guest-user a').href = API_BASE_URL+'saml/?sso2';
const AUTH_REQUEST_HEADER_GUEST_USER = 'Basic '+
//btoa('eyJhbGciOiJIUzI1NiIsImV4cCI6MTUyMzk2MTM5MSwiaWF0IjoxNTIzODc0OTkxfQ.ey'+
//'JpZCI6ImdodWhzIn0.9jYbcdOpjT9vWqvqE1Xm1p1vrjpQRKKEzuKGXx6orEs:');
btoa('eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+
'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4:');
......
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