rust-webx-spa 0.10.0

rust-webx SPA: static file serving middleware
Documentation
//! SPA static file serving middleware (package `rust-webx-spa`, imported as
//! `webx_spa`).
//!
//! Serves files from a disk directory, from a table compiled into the binary,
//! or both (disk wins), with history fallback to `index.html`. Embedded files
//! are streamed with `ETag`, `Range`, and `HEAD` support.

pub mod assets;
mod embed;
mod spa;

pub use embed::{ContentEncoding, EmbeddedAsset, EmbeddedAssets};
pub use spa::{SpaMiddleware, SpaSource, EMBED_ENV};

/// Re-exported so build-script-generated code can register a table without
/// depending on `inventory` directly.
pub use inventory;

/// Include the asset table generated by `webx::builder()` in `build.rs`.
///
/// Prefer `#[webx::main(embed)]` in application code. This bang-macro is
/// the low-level include used by that attribute (and by
/// `#[webx::embed_assets]` in integration tests).
///
/// ```ignore
/// // Usually you do not call this directly:
/// webx::spa::embed_assets!();
/// ```
#[macro_export]
macro_rules! embed_assets {
    () => {
        include!(concat!(env!("OUT_DIR"), "/webx_embedded_assets.rs"));
    };
}