Documentation
¶
Overview ¶
Package server implements the live-reloading development server for kwelea.
The entry point is Start, which:
- Runs an initial builder.Build to populate the output directory.
- Binds to the configured port (auto-incrementing up to +10 if occupied).
- Starts a Hub goroutine that broadcasts WebSocket reload signals to all connected browser tabs.
- Starts an fsnotify watcher over the docs directory and kwelea.toml; on any change it rebuilds and calls Hub.Reload.
- Serves the output directory over HTTP and handles WebSocket upgrades at /_kwelea/ws.
- Optionally opens the browser at the resolved URL.
The server shuts down cleanly on SIGTERM or SIGINT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
Start is the entry point for `kwelea serve`. It:
- Runs an initial build in devMode
- Resolves an available port (base..base+10)
- Starts the WebSocket hub and file watcher
- Serves the output directory as a static site
- Opens the browser (unless disabled)
- Blocks until SIGINT/SIGTERM, then shuts down cleanly
Types ¶
Click to show internal directories.
Click to hide internal directories.