Initial Commit
This commit is contained in:
16
index.js
Normal file
16
index.js
Normal file
@@ -0,0 +1,16 @@
|
||||
function sendData(data) {
|
||||
fetch('http://localhost:5000/api/send', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ message: data })
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
document.getElementById('response').innerText = data.reply;
|
||||
})
|
||||
.catch(err => console.error('Error:', err));
|
||||
}
|
||||
|
||||
sendData("reset")
|
||||
Reference in New Issue
Block a user