forked from typicode/json-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.html
51 lines (41 loc) · 1.48 KB
/
page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>A Basic HTML5 Template</title>
<meta name="description" content="A simple HTML5 Template for new projects.">
<meta name="author" content="SitePoint">
<meta property="og:title" content="A Basic HTML5 Template">
<meta property="og:type" content="website">
<meta property="og:url" content="">
<meta property="og:description" content="A simple HTML5 Template for new projects.">
<meta property="og:image" content="image.png">
<script src="https://unpkg.com/htmx.org@1.8.4"
integrity="sha384-wg5Y/JwF7VxGk4zLsJEcAojRtlVp1FKKdGy1qN+OMtdq72WRvX/EdRdqg/LOhYeV"
crossorigin="anonymous"></script>
</head>
<body>
<!-- your content here... -->
<script type="text/javascript">
const endpoint = "http://localhost:3000"
document.body.addEventListener('htmx:configRequest', function (evt) {
evt.detail.path = endpoint + evt.detail.path
});
</script>
<button class="boop-btn"
hx-post="/boops"
hx-trigger="click"
hx-target=".new-boop">
Click to BOOP</button>
<div class="new-boop"></div>
<div class="boops"
hx-get="/boops"
hx-trigger="load, click from:.boop-btn"
hx-target=".boop-list"
hx-swap="outerHTML">
<h3>Boops:</h3>
<ul class="boop-list"></ul>
</div>
</body>
</html>