From 5c2f9a19d653d2a57992c2518e6240ae666e0bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Mon, 25 Mar 2019 11:21:33 +0200 Subject: [PATCH] Make the UI perform XHRs relative to its own path --- ui/vue.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/vue.html b/ui/vue.html index ec4e882..74c9986 100644 --- a/ui/vue.html +++ b/ui/vue.html @@ -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",