5 unstable releases

new 0.3.0 Sep 14, 2020
0.2.0 Aug 10, 2020
0.1.2 Sep 20, 2018
0.1.1 Sep 17, 2018
0.1.0 Aug 24, 2018

#73 in HTTP server

36 downloads per month

MIT/Apache

9KB
142 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 = "0.3.0"

And this to your crate root:

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

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(
        || App::new()
            .wrap(RequestIDService::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

~20MB
~469K SLoC