-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.tsx
33 lines (27 loc) · 841 Bytes
/
index.tsx
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
import { Page } from "../../components/Page.tsx";
import { handlePage } from "../../lib/handle_page.ts";
import { Markdown } from "../../components/Markdown.tsx";
export default handlePage(({ req }) => (
<Page req={req} module={import.meta.url}>
<h2>Server Sent Events Demo</h2>
<details open>
<summary>What is this?</summary>
<Markdown url={import.meta.resolve("./_doc.md")} />
</details>
<h3>Control:</h3>
<div class="box">
<div id="control">
<span>Feed has not yet started. Hit the button... </span>
<button hx-get="/sse/start" hx-target="#control" hx-swap="outerHTML">
Start
</button>
</div>
</div>
<h3>Output:</h3>
<div class="box">
<div id="output">
<div>Feed appears here:</div>
</div>
</div>
</Page>
));