async function sendText() { const text = document.getElementById("textInput").value; const response = await fetch("/api/process", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({text: text}) }); const data = await response.json(); document.getElementById("result").innerText = data.result; }