Make the UI perform XHRs relative to its own path

This commit is contained in:
Lucas Käldström
2019-03-25 11:21:33 +02:00
committed by GitHub
parent 7d5200a78a
commit 5c2f9a19d6
+2 -2
View File
@@ -147,7 +147,7 @@
getInfo: function() {
var xhr = new XMLHttpRequest()
var self = this
xhr.open('GET', "/api/info")
xhr.open('GET', "api/info")
xhr.onload = function () {
data = JSON.parse(xhr.responseText)
// reload page when the version changes
@@ -170,7 +170,7 @@
},
postBackend: function() {
var self = this
fetch("/api/echo", {
fetch("api/echo", {
method: 'post',
headers: {
"Content-type": "application/json; charset=UTF-8",