diff --git a/config.template.js b/config.template.js index a3520b2..3d5a7bd 100644 --- a/config.template.js +++ b/config.template.js @@ -1,5 +1,6 @@ (function() { var hostname = window.location.hostname; + var origin = window.location.protocol + '//' + hostname + (window.location.port ? ':' + window.location.port : ''); var params = new URLSearchParams(window.location.search.slice(1)); BR.conf = {}; @@ -11,7 +12,7 @@ // TODO not included in permalink (better replace permalink with hash plugin) //BR.conf.transit = params.has('transit') && (params.get('transit') === 'true'); - if (hostname === 'brouter.de') { + if (hostname.endsWith('brouter.de')) { // online service (brouter.de) configuration BR.conf.profiles = [ @@ -35,8 +36,8 @@ 'hiking-beta' ]; - BR.conf.host = 'http://brouter.de:443'; - BR.conf.profilesUrl = 'http://brouter.de/brouter/profiles2/'; + BR.conf.host = origin; + BR.conf.profilesUrl = origin + '/brouter/profiles2/'; } else { // desktop configuration