Lesson 41 of 50
rustUsing Actix Web
20 minutes
Course progress82%
Using Actix Web
Actix Web is a powerful, pragmatic web framework.
[dependencies]
actix-web = \"4\"
use actix_web::{get, App, HttpResponse, HttpServer, Responder};
#[get(\"/\")]
async fn index() -> impl Responder {
HttpResponse::Ok().body(\"Hello from Actix!\")
}
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| App::new().service(index))
.bind(\"127.0.0.1:8080\")?
.run()
.await
}