Skip to main content

Module web

Module web 

Source
Expand description

Web server module for browser-based UI.

Provides a locally hosted HTTP server with REST API endpoints and a web UI that mirrors all CLI functionality. Supports foreground and daemon modes.

§Web Server Module

Provides a locally hosted HTTP server with REST API endpoints and a single-page web UI that mirrors all CLI functionality. The server uses the same Config and DefaultClientFactory as the CLI, ensuring identical behavior.

§Usage

# Start in foreground (default port 8080)
scope web

# Custom port and bind address
scope web --port 3000 --bind 0.0.0.0

# Run as background daemon
scope web --daemon

# Stop a running daemon
scope web --stop

Modules§

api
Web API Handlers
monitor
WebSocket monitor handler for live token data streaming.

Structs§

AppState
Shared application state passed to all handlers via Axum extractors.

Functions§

build_router
Builds the Axum router with all API routes and static file serving.
is_daemon_child
Returns true if running as a daemon child process.
log_file_path
Returns the path to the log file for the daemon.
pid_file_path
Returns the path to the PID file for the daemon.
start_daemon
Starts the server as a background daemon (Unix only).
start_server
Starts the web server on the given address.
stop_daemon
Stops a running daemon by reading its PID file and sending SIGTERM.