Skip to main content

serve

Function serve 

Source
pub async fn serve(config: Config) -> Result<(), Error>
Expand description

Runs build_app and serves it on 0.0.0.0:{config.port} until the server fails; under normal operation it does not return. Each request carries its peer address (ConnectInfo<SocketAddr>), which the key-check limit counts unless TRUST_FORWARDED_FOR says otherwise. A caller that serves build_app’s router itself should do the same (into_make_service_with_connect_info::<SocketAddr>()); without it, and without a trusted X-Forwarded-For, every client shares one limit.