INNER CODE UNIT · Rust

configured_api_host

shenmintao/marginalia · desktop/src-tauri/src/lib.rs:202

fn configured_api_host(home: &Path) -> String {
    configured_env_value(home, "MARGINALIA_API_HOST").unwrap_or_else(|| "127.0.0.1".to_string())
}

fn configured_api_port(home: &Path) -> Option<u16> {
    configured_env_value(home, "MARGINALIA_API_PORT").and_then(|value| match value.parse::<u16>() {
        Ok(port) => Some(port),
        Err(e) => {
            log::warn!("ignoring invalid MARGINALIA_API_PORT={}: {}", value, e);
            None
        }
    })
}

fn client_base_url(host: &str, port: u16) -> String {
    let mut client_host = host.trim();
    if client_host.is_empty() || client_host == "0.0.0.0" || client_host == "::" {
        client_host = "127.0.0.1";

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…