1#![doc = include_str!("../README.md")]
2pub mod mime;
8
9mod types;
10
11use rand::{Rng, distr::Alphanumeric};
12pub use types::*;
13
14mod router;
15pub use router::*;
16
17mod servable;
18pub use servable::*;
19
20#[cfg(test)] use tower_http as _;
22
23#[cfg(feature = "image")]
28pub mod transform;
29
30pub static CACHE_BUST_STR: std::sync::LazyLock<String> = std::sync::LazyLock::new(|| {
35 rand::rng()
36 .sample_iter(&Alphanumeric)
37 .take(10)
38 .map(char::from)
39 .collect()
40});
41
42#[cfg(feature = "htmx-2.0.8")]
48pub const HTMX_2_0_8: servable::StaticAsset = servable::StaticAsset {
49 bytes: include_str!("../htmx/htmx-2.0.8.min.js").as_bytes(),
50 mime: mime::MimeType::Javascript,
51 ttl: StaticAsset::DEFAULT_TTL,
52};
53
54#[cfg(feature = "htmx-2.0.8")]
58pub const EXT_JSON_1_19_12: servable::StaticAsset = servable::StaticAsset {
59 bytes: include_str!("../htmx/json-enc-1.9.12.js").as_bytes(),
60 mime: mime::MimeType::Javascript,
61 ttl: StaticAsset::DEFAULT_TTL,
62};