#web #http #performance #high #potato

macro potato-macro

A very simple and high performance http library

20 releases

new 0.1.24 Mar 18, 2025
0.1.23 Jan 23, 2025
0.1.6 Dec 29, 2024

#134 in #high

Download history 49/week @ 2024-12-12 454/week @ 2024-12-19 331/week @ 2024-12-26 775/week @ 2025-01-02 285/week @ 2025-01-09 347/week @ 2025-01-16 183/week @ 2025-01-23 16/week @ 2025-01-30 17/week @ 2025-02-06 6/week @ 2025-02-13 5/week @ 2025-02-20 64/week @ 2025-03-13

72 downloads per month
Used in potato

MIT license

15KB
289 lines

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

~1–1.9MB
~38K SLoC