#actix-web #web-framework #framework #async #web #actix

endless-web

Actix web 是一个简单、实用且极其快速的 Rust Web 框架

1 个稳定版本

2.0.0 2020 年 1 月 18 日

#639HTTP 服务器

MIT/Apache

1.5MB
33K SLoC

关于仓库

这是由 Nikolay Kim 创建的 actix-web 框架的分支。原始仓库托管在 actix/actix-web。原始代码: fafhrd91/actix-web

Actix web

Actix web 是一个小巧、实用且极其快速的 Rust Web 框架

Build Status codecov Join the chat at https://gitter.im/actix/actix Documentation Download Version License

网站 | 聊天 | 示例


Actix web 是一个简单、实用且极其快速的 Rust Web 框架。

示例

依赖项

[dependencies]
actix-web = "2"
actix-rt = "1"

代码

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

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

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

更多示例

您可以考虑查看 此目录 以获取更多示例。

基准测试

许可协议

本项目许可协议为以下之一

任选其一。

行为准则

对actix-web crate的贡献是在贡献者公约的条款下组织的,actix-web的维护者@fafhrd91承诺将介入维护该行为准则。

依赖项

~21–28MB
~595K SLoC