Skip to content
Snippets Groups Projects
Unverified Commit c2c603d5 authored by meskio's avatar meskio :tent: Committed by Kali Kaneko
Browse files

[feature] set a default localhost:7070 if bitmask.js is loaded from file

parent b5e628de
Branches
Tags
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment