Skip to main content

local_http_host

Function local_http_host 

Source
pub fn local_http_host(flag: Option<&str>) -> (String, HostOrigin)
Expand description

resolve_http_host against this process’s environment: what serve, mcp and server.status all read, so that the address a server binds and the address the status calls desired cannot disagree.

use majordomus_cli::cli::{local_http_host, HostOrigin};
// a flag is the answer whatever the environment holds
assert_eq!(
    local_http_host(Some("127.0.0.1")),
    ("127.0.0.1".to_string(), HostOrigin::Flag)
);