diff options
author | hellekin <hellekin@cepheide.org> | 2018-03-09 14:59:47 +0100 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2018-03-09 14:59:47 +0100 |
commit | 0397fc21cb462775af898a031da92c2b893ca42d (patch) | |
tree | bea1039621857c6bfd1f8710f418cc4336473f0d /assets | |
parent | 6fea1b938966c8bbde8dcfa06c401b0625553347 (diff) | |
download | wallonie-demain-proto-0397fc21cb462775af898a031da92c2b893ca42d.tar.gz |
Make deployment transparent to the app -- JavaScript...
Diffstat (limited to 'assets')
-rw-r--r-- | assets/mapper.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/assets/mapper.js b/assets/mapper.js index e4451a5..083405b 100644 --- a/assets/mapper.js +++ b/assets/mapper.js @@ -146,12 +146,13 @@ Categories.forEach(function(c) { }) // Where do we get our JSON data from -if (location.href.includes('localhost')) { - const api_base = 'http://localhost/data/' -} else { - const api_base = 'https://map.incommon.cc/data/' - //const api_base = 'http://maps.dewey.be/api' +function apiBaseUrl() { + if (location.href.includes('localhost')) { + return 'http://localhost/data/' + } + return 'https://map.incommon.cc/data/' } +const api_base = apiBaseUrl() const cat_uri = api_base + '/categories.json' /** |