Crates.io | actix-treblle |
lib.rs | actix-treblle |
version | 4.0.5 |
source | src |
created_at | 2022-05-25 18:17:59.3842 |
updated_at | 2022-05-31 19:46:47.175136 |
description | Treblle makes it super easy to understand what's going on with your APIs and the apps that use them. |
homepage | https://www.treblle.com |
repository | https://github.com/barrage/actix-treblle |
max_upload_size | |
id | 593676 |
size | 33,724 |
actix-treblle = "4.0.5"
Treblle.com connector for Rust Actix web framework.
Treblle makes it super easy to understand what's going on with your APIs and the apps that use them.
Go to Treblle.com register and create a project, copy your project_id
and go and get your api_key
from settings.
Add this crate to your Rust Actix v4 powered application as a regular middleware, give it project_id
and api_key
, turn on the features you might need
and thats it! Watch your requests get logged in Treblle project.
Example:
use actix_web::{App, HttpServer};
use actix_treblle::Treblle;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.wrap(Treblle::new("project_id".to_string(), "api_key".to_string()))
.route("/hello", web::get().to(|| async { "Hello World!" }))
})
.bind(("127.0.0.1", 8080))?
.run()
.await
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.