Hello World
Signals, requests and realtime streams between the browser and the Network API.
This page gathers what the portal theme does with data-* attributes and what the Network API answers at /api/hello-world/*. Each block is tried right here: the browser keeps state in signals, the server answers with SSE events that change the HTML or the signals, and an open stream pushes data without the page asking again.
Signals in the browser
State lives in the HTML. Typing your name changes the greeting, the letter count and the bar, without a trip to the server.
0 letters of 40
Type your name to see the greeting.
Show the signals
The server answers over SSE
The button sends your name to GET /api/hello-world/greeting. Hono validates the name and returns an SSE event with the #greeting element, which the browser merges in place.
The server writes signals
POST /api/hello-world/counter receives the count, increments it and returns the new signals. The browser does not add: it only shows what the server decides.
Count: 0
Realtime stream
GET /api/hello-world/clock keeps the connection open and pushes one event per second: the server time, a log line and the progress. When the tab is hidden, the browser closes the stream and opens it again on return.
- Server time
—
- Browser time
- —
Stream log
Load on arrival
This block requests its content only when it scrolls into view. GET /api/hello-world/edge answers with the network node that served the request.
The block loads once it is visible.