#performance #high #http #web

potato

A very simple and high performance http library

22 releases

new 0.1.21 Jan 20, 2025
0.1.20 Jan 19, 2025
0.1.7 Dec 30, 2024

#1189 in Network programming

Download history 248/week @ 2024-12-15 391/week @ 2024-12-22 984/week @ 2024-12-29 548/week @ 2025-01-05 427/week @ 2025-01-12

2,377 downloads per month

MIT license

4MB
1.5K SLoC

potato

version status

高性能、简洁语法的HTTP框架。

用法

加入库的引用:

cargo add potato
cargo add tokio --features full

Hello World

use potato::*;

// http://127.0.0.1:8080/hello
#[http_get("/hello")]
async fn hello() -> HttpResponse {
    HttpResponse::html("hello world")
}

#[tokio::main]
async fn main() {
    let mut server = HttpServer::new("0.0.0.0:8080");
    _ = server.serve_http().await;
}

更多示例请参考:https://github.com/fawdlstty/potato/tree/main/examples

Dependencies

~16–27MB
~480K SLoC