Attribute Macro actix_web::main

source ·
#[main]
Available on crate feature macros only.
Expand description

Marks async main function as the Actix Web system entry-point.

Note that Actix Web also works under #[tokio::main] since version 4.0. However, this macro is still necessary for actor support (since actors use a System). Read more in the actix_web::rt module docs.

§Examples

#[actix_web::main]
async fn main() {
    async { println!("Hello world"); }.await
}