From 6fea1b938966c8bbde8dcfa06c401b0625553347 Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 9 Mar 2018 14:52:18 +0100 Subject: Make deployment transparent to the app --- assets/mapper.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'assets') diff --git a/assets/mapper.js b/assets/mapper.js index e02553f..e4451a5 100644 --- a/assets/mapper.js +++ b/assets/mapper.js @@ -146,9 +146,12 @@ Categories.forEach(function(c) { }) // Where do we get our JSON data from -const api_base = 'http://localhost/data/' -//const api_base = 'https://map.incommon.cc/data/' -//const api_base = 'http://maps.dewey.be/api' +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' +} const cat_uri = api_base + '/categories.json' /** -- cgit v1.2.3