customize template
This commit is contained in:
+4
-18
@@ -1,4 +1,7 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<link rel="icon" href="data:image/png;base64,iVBORw0KGgo=">
|
||||
</head>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@@ -10,23 +13,6 @@
|
||||
<p>This page comes from a static asset stored at `public/index.html` as configured in `wrangler.jsonc`.</p>
|
||||
<button id="button" type="button">Fetch a random UUID</button>
|
||||
<output id="random" for="button"></output>
|
||||
<script>
|
||||
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;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
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;
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user