actix-web README

The project's README from github.com/actix/actix-web. As one markdown file: README.md.

Actix Web

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

crates.io Documentation MSRV MIT or Apache 2.0 licensed Dependency Status
CI Coverage downloads Chat on Discord

Features

Experimental features

To enable faster release iterations, we mark some features as experimental. These features are prefixed with experimental and a breaking change may happen at any release. Please use them in a production environment at your own risk.

Documentation

Example

Dependencies:

[dependencies]
actix-web = "4"

Code:

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

#[get("/hello/{name}")]
async fn greet(name: web::Path<String>) -> impl Responder {
    format!("Hello {name}!")
}

#[actix_web::main] // or #[tokio::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new().service(greet)
    })
    .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 the following licenses, at your option:

Code of Conduct

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

actix-web (actix/actix-web)

Searching Database…

24.9K ·GitHub
What is this?Actix Web is a powerful, pragmatic and extremely fast web framework for Rust, used to build web servers, APIs and realtime services.
Is it a full framework or just a thin HTTP library?A full web framework: request routing with optional macros, middlewares, WebSockets, static assets, content compression and an integrated HTTP client come as one package.
How do I start building a server with it?Add the actix-web crate to your Cargo.toml and start from the Hello World or Basic Setup examples in the project's examples repository.
Which Rust version do I need, and is async support included?Stable Rust 1.88 or newer is enough, and async comes built in: the framework is fully Tokio compatible, so no extra runtime setup is needed.
Are any parts of it unstable or risky to depend on?Features prefixed with 'experimental' can change at any release, and the README says to use them in production at your own risk.
Is it free to use in commercial projects?Yes, it is dual-licensed under Apache-2.0 and MIT, and you choose whichever of the two licenses applies to your project.
Is it actually one of the fastest web frameworks?The README points to the TechEmpower Framework Benchmark, where Actix Web ranks among the fastest web frameworks available.
Does it only serve incoming requests, or can it make HTTP calls too?Both: besides the server side, it integrates with the awc HTTP client for making outgoing requests.
Are there ready examples for databases and WebSockets?Yes. The examples repository covers JSON handling, MongoDB, Diesel, SQLite and Postgres integration, Tera and Askama templates, HTTPS with Rustls or OpenSSL, and a WebSocket chat.
What are similar projects?echo, warp, starlette, Rocket, aiohttp, axum, pingora, nginxconfig.io
Creator
actix
Size
18.1 MB
Stars
24.9K
Age
9y
Commits · 90 Days