Expand description
§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 --stopModules§
- api
- Web API Handlers
- auth
- Optional bearer token authentication middleware.
- 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.
- daemon_
dir - The folder of the daemon’s PID and log files.
- is_
daemon_ child - Returns true if running as a daemon child process.
- legacy_
pid_ file_ path - Where versions before
~/.scope-bca(0.7.0 and older) kept the PID file. The migration does not copy it: a daemon those versions started is still found here (#106). - 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.
Tells the user what happened, as notes on
out.