Skip to content
Snippets Groups Projects
Commit f863a7c3 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Merge branch 'Issue/xxxx-configurableApiHostname' into 'main'

New: Configurable api hostname

See merge request !15
parents abb56033 5a1ba8c9
No related branches found
No related tags found
1 merge request!15New: Configurable api hostname
...@@ -90,6 +90,10 @@ if (typeof window !== 'undefined') { ...@@ -90,6 +90,10 @@ if (typeof window !== 'undefined') {
} }
const getHostName = () => { const getHostName = () => {
const localStorageHostName = typeof window !== 'undefined' ? localStorage.getItem('coscine.api.hostname') : null;
if (localStorageHostName) {
return localStorageHostName;
}
let hostName = typeof window !== 'undefined' ? window.location.hostname : 'coscine.rwth-aachen.de'; let hostName = typeof window !== 'undefined' ? window.location.hostname : 'coscine.rwth-aachen.de';
if (hostName.indexOf(':') !== -1) { if (hostName.indexOf(':') !== -1) {
if (hostName.indexOf('https://') !== -1) { if (hostName.indexOf('https://') !== -1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment