debugging fetch
Browse files- index.html +4 -1
index.html
CHANGED
@@ -22,7 +22,10 @@
|
|
22 |
const prompt = textbox.value
|
23 |
btn.addEventListener("click", event => {
|
24 |
fetch(`/gpt?prompt=${prompt}`)
|
25 |
-
.then(res =>
|
|
|
|
|
|
|
26 |
.then(res => {
|
27 |
console.log(res)
|
28 |
res.textContent = res
|
|
|
22 |
const prompt = textbox.value
|
23 |
btn.addEventListener("click", event => {
|
24 |
fetch(`/gpt?prompt=${prompt}`)
|
25 |
+
.then(res => {
|
26 |
+
console.log(res)
|
27 |
+
res.json()
|
28 |
+
})
|
29 |
.then(res => {
|
30 |
console.log(res)
|
31 |
res.textContent = res
|