const inputUsername = document.getElementById("input-signup-username"); const inputPassword = document.getElementById("input-signup-password"); const buttonSignup = document.getElementById("button-signup"); const resultTxt = document.getElementById("result-text"); buttonSignup.onclick = async () => { const username = inputUsername.value; const password = inputPassword.value; // console.log(username); // console.log(password); const res = await fetch("http://127.0.0.1:8080/api/user/signup", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "username": username, "password": password }) }); const resJson = await res.text(); resultTxt.textContent = `${res.status} ${resJson}`; };