King / app.js
Trkaga's picture
Create app.js
31de276 verified
raw
history blame contribute delete
587 Bytes
async function login() {
await fetch("/api/register", {
method: "POST",
headers: {"Content-Type":"application/json"},
body: JSON.stringify({
email: "test@mail.com",
password: "1234"
})
});
}
async function generate() {
let prompt = document.getElementById("prompt").value;
let res = await fetch("/api/generate", {
method: "POST",
headers: {"Content-Type":"application/json"},
body: JSON.stringify({
prompt,
email: "test@mail.com"
})
});
let data = await res.json();
document.getElementById("result").src = data;
}