@itutoring/itutoring_application_js_api 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apiController.js +9 -1
- package/package.json +1 -1
package/apiController.js
CHANGED
|
@@ -171,7 +171,14 @@ class APIController
|
|
|
171
171
|
resolve(APIController.#CLIENT_KEY);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
|
|
174
|
+
let keyPath = '/client_key.xml';
|
|
175
|
+
// For localhost use different xml file (to make suer we won't revwrite the server key when uploading websites)
|
|
176
|
+
if (location.hostname === "localhost")
|
|
177
|
+
{
|
|
178
|
+
keyPath = '/local_client_key.xml'
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
fetch(keyPath).then(response => response.text()).then((data) =>
|
|
175
182
|
{
|
|
176
183
|
var parser = new DOMParser();
|
|
177
184
|
var keyXML = parser.parseFromString(data, "text/xml");
|
|
@@ -180,6 +187,7 @@ class APIController
|
|
|
180
187
|
APIController.#CLIENT_KEY = key;
|
|
181
188
|
resolve(APIController.#CLIENT_KEY);
|
|
182
189
|
});
|
|
190
|
+
|
|
183
191
|
});
|
|
184
192
|
}
|
|
185
193
|
|