Skip to main content

serve_admin_from_env

Function serve_admin_from_env 

Source
pub async fn serve_admin_from_env(default_addr: &str) -> Result<()>
Expand description

Like serve_admin, but with the bind address from the environment.

This function reads KRABKA_ADMIN_LISTEN_ADDR and falls back to default_addr.

§Errors

Returns an error if the listener cannot bind or the HTTP server fails.

§Panics

Panics if the environment variable, or default_addr when it is absent, is not a socket address.