Expand description
Axum integration module.
Provides pre-built handlers and router for Axum 0.7.x/0.8.x.
§Quick Start
ⓘ
use html2pdf_api::prelude::*;
use html2pdf_api::integrations::axum::router;
#[tokio::main]
async fn main() {
let pool = init_browser_pool().await.unwrap();
let app = router().with_state(pool);
let listener = tokio::net::TcpListener::bind("127.0.0.1:8080")
.await
.unwrap();
axum::serve(listener, app).await.unwrap();
}§Available Exports
| Export | Description |
|---|---|
router | Create router with 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>> |
See crate::integrations::axum for full documentation.
Re-exports§
pub use crate::integrations::axum::*;