diff --git a/static/index.js b/static/index.js index 2d25990..ae6600c 100644 --- a/static/index.js +++ b/static/index.js @@ -2,6 +2,7 @@ var messages = document.getElementById('messages'); var form = document.getElementById('form'); var input = document.getElementById('input'); +const server = new URLSearchParams(document.location.search).get('server') || '/'; async function goPage(count) { let counter = input.value.match(/[^\s]+$/g); @@ -42,7 +43,7 @@ async function main(e) { if (!input.value) return false; - let msg = await fetch("/", { + let msg = await fetch(server, { "method": "POST", "headers": { "content-type": "application/json", @@ -69,7 +70,7 @@ document.querySelector('.next').addEventListener('click', (e) => { e.preventDefa input.value = '/help 1'; goPage(0); -setTimeout(function() { +setTimeout(function () { input.value = '/inv 1'; goPage(0); -},500) \ No newline at end of file +}, 500) \ No newline at end of file