-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
31 lines (26 loc) · 921 Bytes
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>gRPC-Web Example</title>
<script src="https://unpkg.com/[email protected]" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
<script src="./main.js"></script>
</head>
<body>
<h1>CRUD with gRPC.</h1>
<p>Create</p>
<ul id="create-items">
<li class="item">foo</li>
</ul>
<form hx-ext="grpc" grpc-method="addItem" hx-target="#create-items" hx-swap="beforeend" hx-indicator="#spinner">
<input type="text" id="title" placeholder="title">
<input type="text" id="id" placeholder="id">
<button type="submit" >Create</button>
</form>
<hr>
<ul id="read-items">
<li class="item">bar</li>
</ul>
<button hx-ext="grpc" grpc-method="readItem" hx-trigger="click" hx-target="#read-items" hx-swap="beforeend" hx-indicator="#spinner">Read</button>
</body>
</html>