summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/app/lib/bitmask.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/www/app/lib/bitmask.js b/www/app/lib/bitmask.js
index 5bd684b..2cdb9fe 100644
--- a/www/app/lib/bitmask.js
+++ b/www/app/lib/bitmask.js
@@ -33,8 +33,13 @@ import "babel-polyfill";
var bitmask = function(){
var event_handlers = {};
+ var api_url = '/API/';
+ if (window.location.protocol === "file:") {
+ api_url = 'http://localhost:7070/API/';
+ }
+
function call(command) {
- var url = '/API/' + command.slice(0, 2).join('/');
+ var url = api_url + command.slice(0, 2).join('/');
var data = JSON.stringify(command.slice(2));
return new Promise(function(resolve, reject) {