Fix the URL generated in the YASGUI editor to take into account potential trailing slashes

pull/186/head
Vincent Emonet 3 years ago committed by Thomas Tanon
parent a6ecd3d6e1
commit b97e358001
  1. 7
      server/templates/query.html

@ -10,13 +10,14 @@
<body> <body>
<div id="yasgui"></div> <div id="yasgui"></div>
<script> <script>
const url = window.location.href.endsWith('/') ? window.location.href.slice(0, -1) : window.location.href;
new Yasgui(document.getElementById("yasgui"), { new Yasgui(document.getElementById("yasgui"), {
requestConfig: { endpoint: window.location.protocol + '//' + window.location.host + window.location.pathname + "/query" }, requestConfig: { endpoint: url + "/query" },
endpointCatalogueOptions: { endpointCatalogueOptions: {
getData: function () { getData: function () {
return [ return [
{ endpoint: window.location.protocol + '//' + window.location.host + window.location.pathname + "/query" }, { endpoint: url + "/query" },
{ endpoint: window.location.protocol + '//' + window.location.host + window.location.pathname + "/update" }, { endpoint: url + "/update" },
]; ];
}, },
keys: [], keys: [],

Loading…
Cancel
Save