serve

Function serve 

Source
pub(crate) async fn serve(
    listen: String,
    pool: PgPool,
) -> Result<(), Box<dyn Error + Send + Sync>>
Expand description

Starts the HTTP API server and listens for requests.

Binds to the given listen address and serves the operational visibility endpoints documented at the module level. Runs until the caller aborts the returned future (e.g. during SIGTERM handling in main).

§Errors

Returns an error if:

  • listen is not a valid SocketAddr (e.g. missing port).
  • The TCP listener cannot bind (port in use, permission denied).
  • axum::serve returns an I/O error (effectively never — see the axum docs, the underlying future currently never completes).