#actix #http #web #framework #async

actix-web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust

111 releases (18 stable)

4.0.0-beta.6 Apr 17, 2021
4.0.0-beta.4 Mar 10, 2021
3.3.2 Dec 1, 2020
3.3.1 Nov 29, 2020
0.2.1 Nov 3, 2017

#1 in HTTP server

Download history 48082/week @ 2021-02-24 41221/week @ 2021-03-03 45300/week @ 2021-03-10 43849/week @ 2021-03-17 43875/week @ 2021-03-24 35777/week @ 2021-03-31 39879/week @ 2021-04-07 39141/week @ 2021-04-14 38565/week @ 2021-04-21 42515/week @ 2021-04-28 41193/week @ 2021-05-05 43496/week @ 2021-05-12 45832/week @ 2021-05-19 51254/week @ 2021-05-26 42420/week @ 2021-06-02 37346/week @ 2021-06-09

178,624 downloads per month
Used in 406 crates (379 directly)

MIT/Apache

1.5MB
31K SLoC

Actix Web

Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust

crates.io Documentation Version MIT or Apache 2.0 licensed Dependency Status
build status codecov downloads Chat on Discord

Features

  • Supports HTTP/1.x and HTTP/2
  • Streaming and pipelining
  • Keep-alive and slow requests handling
  • Client/server WebSockets support
  • Transparent content compression/decompression (br, gzip, deflate)
  • Powerful request routing
  • Multipart streams
  • Static assets
  • SSL support using OpenSSL or Rustls
  • Middlewares (Logger, Session, CORS, etc)
  • Includes an async HTTP client
  • Runs on stable Rust 1.46+

Documentation

Example

Dependencies:

[dependencies]
actix-web = "3"

Code:

use actix_web::{get, web, App, HttpServer, Responder};

#[get("/{id}/{name}/index.html")]
async fn index(web::Path((id, name)): web::Path<(u32, String)>) -> impl Responder {
    format!("Hello {}! id:{}", name, id)
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().service(index))
        .bind("127.0.0.1:8080")?
        .run()
        .await
}

More examples

You may consider checking out this directory for more examples.

Benchmarks

One of the fastest web frameworks available according to the TechEmpower Framework Benchmark.

License

This project is licensed under either of

at your option.

Code of Conduct

Contribution to the actix-web repo is organized under the terms of the Contributor Covenant. The Actix team promises to intervene to uphold that code of conduct.

Dependencies

~22MB
~524K SLoC