Update index.html
Browse files123456789101112131415161718192021222324252627<!DOCTYPE html><html><body><input id="msg" placeholder="Ask something"><button onclick="send()">Send</button><p id="reply"></p><script>async function send() {const msg = document.getElementById("msg").value;const res = await fetch("/chat", {method: "POST",headers: {"Content-Type": "application/json"},body: JSON.stringify({message: msg})});const data = await res.json();document.getElementById("reply").innerText = data.reply;}</script></script></body></html>1234567891011121314151617181920212223242526272829<!DOCTYPE html><html><head><title>Chatbot Test</title></head><body><h2>Chatbot</h2><input id="msg" placeholder="Type message..." /><button onclick="send()">Send</button><pre id="reply"></pre><script>async function send() {const msg = document.getElementById("msg").value;const res = await fetch("/chat", {method: "POST",headers: {"Content-Type": "application/json"},body: JSON.stringify({ message: msg })});const data = await res.json();document.getElementById("reply").innerText = data.reply;}</script></body></html>
index.html+17-15