Skip to main content

http_server

Attribute Macro http_server 

Source
#[http_server]
Expand description

Enables a HTTP server main function, for creating HTTP servers.

§Examples

#[wstd::http_server]
async fn main(request: Request<Body>) -> Result<Response<Body>> {
    Ok(Response::new("Hello!\n".into()))
}