diff --git a/create_invoice.html b/create_invoice.html index a6e33e8..767b3ed 100644 --- a/create_invoice.html +++ b/create_invoice.html @@ -4,7 +4,7 @@ -
+ diff --git a/index.html b/index.html index 4fd3104..038add7 100644 --- a/index.html +++ b/index.html @@ -59,7 +59,7 @@

QR Code:

var id = getUrlParameter('id'); if (id) { - var jqxhr = $.getJSON("/api/get_invoice?" + id, function() { + var jqxhr = $.getJSON("api/get_invoice?" + id, function() { console.log("getJSON:success"); }) .done( function(data) { @@ -105,7 +105,7 @@

QR Code:

} }); - var wss_address = (document.URL.startsWith("https") ? "wss" : "ws") + "://" + window.location.host +"/api/get_status?" + id; + var wss_address = document.URL.replace("http", "ws").match("(.*)/")[1] + "/api/get_status?" + id; console.log("Opening WSS: " + wss_address) var ws = new WebSocket(wss_address); var received_msg;