Lesson 41 of 50 · rust
Using Actix Web
Duration: 20 minutes
Lesson 41 of 50 · rust
Duration: 20 minutes
toml\n[dependencies]\nactix-web = \"4\"\n\n\nrust\nuse actix_web::{get, App, HttpResponse, HttpServer, Responder};\n\n#[get(\"/\")]\nasync fn index() -> impl Responder {\n HttpResponse::Ok().body(\"Hello from Actix!\")\n}\n\n#[actix_web::main]\nasync fn main() -> std::io::Result<()> {\n HttpServer::new(|| App::new().service(index))\n .bind(\"127.0.0.1:8080\")?\n .run()\n .await\n}\n\n