pub async fn bind(
config: ServerConfig,
) -> Result<(TcpListener, Router, CancellationToken)>Expand description
Bind on <SMOOTH_AGENT_BIND>:<port> (default loopback) and serve until the
process is killed. Returns the bound TcpListener + the router, used by
both the binary and tests (tests bind port 0 for an ephemeral port).
Uses the env-configured, secure-by-default auth verifier
(build_state_from_env) — the binary refuses to start if auth is
misconfigured rather than silently serving the admin API unauthenticated.
§Errors
Returns an error if the auth configuration is invalid or the TCP bind fails.