10 releases (3 stable)

2.1.0 Mar 3, 2023
2.0.0-beta.1 Jul 19, 2021
1.1.0 Jun 30, 2021
0.4.0 Mar 9, 2021
0.1.0 Aug 24, 2018

#227 in HTTP server

Download history 24/week @ 2023-08-12 9/week @ 2023-08-19 28/week @ 2023-08-26 22/week @ 2023-09-02 14/week @ 2023-09-09 25/week @ 2023-09-16 19/week @ 2023-09-23 20/week @ 2023-09-30 15/week @ 2023-10-07 29/week @ 2023-10-14 24/week @ 2023-10-21 33/week @ 2023-10-28 15/week @ 2023-11-04 13/week @ 2023-11-11 18/week @ 2023-11-18 64/week @ 2023-11-25

113 downloads per month

MIT/Apache

9KB
140 lines

Actix-web-requestid

CI crates.io Documentation License

A rust library to add a requestid with the actix-web framework.

Usage

Add this to your Cargo.toml:

[dependencies]
actix-web-requestid = "2.1.0"

And this to your crate root:

use actix_web::{web, App, HttpServer, HttpResponse, Error};
use actix_web_requestid::{RequestID, RequestIDMiddlware};

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(
        || App::new()
            .wrap(RequestIDMiddleware::new())
            .service(web::resource("/").to(|| HttpResponse::Ok())))
        .bind("127.0.0.1:59880")?
        .run()
        .await
}

License

actix-web-requestid is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

Dependencies

~17–29MB
~521K SLoC