generated from ElnuDev/go-project
Implement Server-Sent Events
This commit is contained in:
parent
3fc30c0d3a
commit
3a8179a99a
2 changed files with 32 additions and 0 deletions
|
@ -7,6 +7,9 @@
|
|||
<script src="https://unpkg.com/htmx.org@1.9.3"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div hx-sse="connect:/api/counter">
|
||||
<div hx-sse="swap:count"></div>
|
||||
</div>
|
||||
<button hx-get="/api/click1" hx-swap="innerHTML">Click me!</button>
|
||||
<br>
|
||||
<button hx-get="/api/click2" hx-swap="innerHTML">Click me!</button>
|
||||
|
|
Reference in a new issue