remove direct call to Conf structure
authorLaurent Mazet <mazet@softndesign.org>
Tue, 20 Apr 2021 06:43:27 +0000 (08:43 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Tue, 20 Apr 2021 06:43:27 +0000 (08:43 +0200)
public/trivabble.js

index a3d38c91b8f9d632039cc5e2c2b3a461b14b93d3..2057c09b5bff587daa06de4a4d5e715f92a15a25 100644 (file)
             webSocket = new WebSocket(
                 (window.location.protocol === "http:" ? "ws://" : "wss://") +
                 window.location.host +
-                Conf.API_ENTRY_POINT + "/ws/" +
+                getSetting("API_ENTRY_POINT") + "/ws/" +
                 JSON.stringify(cmdsWithContext())
             );
 
     function xhrRequest(data, onreadystatechange) {
         const xhr = new XMLHttpRequest();
 
-        xhr.open("POST", Conf.API_ENTRY_POINT, true);
+        xhr.open("POST", getSetting("API_ENTRY_POINT"), true);
         xhr.setRequestHeader("Content-Type", "text/plain");
         xhr.send(JSON.stringify(data));