Expand description
Actix-web integration module.
Provides pre-built handlers and helpers for Actix-web 4.x.
§Quick Start
ⓘ
use actix_web::{App, HttpServer, web};
use html2pdf_api::prelude::*;
use html2pdf_api::integrations::actix::configure_routes;
#[actix_web::main]
async fn main() -> std::io::Result<()> {
let pool = init_browser_pool().await.unwrap();
HttpServer::new(move || {
App::new()
.app_data(web::Data::new(pool.clone()))
.configure(configure_routes)
})
.bind("127.0.0.1:8080")?
.run()
.await
}§Available Exports
| Export | Description |
|---|---|
configure_routes | Configure all pre-built routes |
pdf_from_url | Handler for URL-to-PDF |
pdf_from_html | Handler for HTML-to-PDF |
pool_stats | Handler for pool statistics |
health_check | Handler for health check |
readiness_check | Handler for readiness check |
SharedPool | Type alias for Arc<Mutex<BrowserPool>> |
BrowserPoolData | Type alias for web::Data<SharedBrowserPool> |
BrowserPoolActixExt | Extension trait for BrowserPool |
See crate::integrations::actix for full documentation.
Re-exports§
pub use crate::integrations::actix::*;