Files
twitch-cloud-ebs/public/script.ts
T
2025-10-20 05:14:06 -07:00

16 lines
462 B
TypeScript

fetch('/message')
.then((resp) => resp.text())
.then((text) => {
const h1 = document.getElementById('heading')!;
h1.textContent = text;
});
const button = document.getElementById("button")!;
button.addEventListener("click", () => {
fetch('/random')
.then((resp) => resp.text())
.then((text) => {
const random = document.getElementById('random')!;
random.textContent = text;
});
});