Skip to main content

serve

Function serve 

Source
pub async fn serve<A: ApiSpec, H: Serves<A>>(
    addr: SocketAddr,
    handlers: H,
) -> Result<(), Box<dyn Error + Send + Sync>>
Expand description

Convenience function to create and serve an API.

§Example

serve::<API, _>("127.0.0.1:3000".parse().unwrap(), (handler1, handler2)).await?;