Examples
September 4, 2026 ยท View on GitHub
Try them live at http-nu.cross.stream/examples/.
Running all examples
The examples hub mounts individual examples under one server:
http-nu --datastar :3001 examples/serve.nu
With a store (enables quotes):
http-nu --datastar --store ./store :3001 examples/serve.nu
Then visit http://localhost:3001.
Local dev: add
--devwhen running over plain HTTP. Examples that set cookies (2048'ssessioncookie, for instance) default toSecure, so the browser drops them onhttp://localhost.--devomits theSecureflag.
Individual examples
Each example can also be run standalone.
| Example | Command | Description |
|---|---|---|
| basic | http-nu :3001 examples/basic.nu | Minimal routes, JSON, streaming, POST echo |
| stor | http-nu :3001 examples/stor.nu | In-memory SQLite with stor commands |
| datastar-counter | http-nu --datastar :3001 examples/datastar-counter/serve.nu | Client-side reactive counter |
| datastar-sdk | http-nu --datastar :3001 examples/datastar-sdk/serve.nu | Datastar SDK feature demo |
| mermaid-editor | http-nu --datastar :3001 examples/mermaid-editor/serve.nu | Live Mermaid diagram editor |
| markdown-mermaid | http-nu :3001 examples/markdown-mermaid/serve.nu | Markdown via .md with Mermaid fences rendered client-side |
| templates | http-nu --datastar --store ./store :3001 examples/templates/serve.nu | .mj file, inline, and topic modes |
| quotes | http-nu --datastar --store ./store :3001 examples/quotes/serve.nu | Live quotes board with SSE |
| tao | http-nu --datastar --dev -w :3001 examples/tao/serve.nu | The Tao of Datastar |
| blog | http-nu :3001 examples/blog/serve.nu | Routing, layouts, HTML composition |
| 2048 | http-nu --dev --datastar --services --store ./store :3001 examples/2048/serve.nu | Multi-game library, event-sourced via snapshot-actor, animated tile slides |
Store-dependent examples
Quotes and the /topic route in templates require --store. The hub
detects $HTTP_NU.store at runtime and greys out unavailable examples.
When --store is provided, templates automatically seeds its topics on
startup.