1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Axum middleware for Forma SSR.
//!
//! Provides page rendering (`render_page`), content-hashed asset serving,
//! CSP headers with cryptographic nonces, service worker handling, and
//! the Phase 1 (client mount) / Phase 2 (SSR reconcile) rendering pipeline.
//!
//! # Quick Start
//!
//! ```rust,no_run
//! use forma_server::{render_page, PageConfig, RenderMode};
//! ```
//!
//! # Serving a page
//!
//! [`PageOutput`]'s `html` and `csp` are a single unit — the HTML embeds a
//! per-request nonce that only that policy blesses. Send them together with
//! `Cache-Control: no-store` (see [`PageOutput::headers`]) and never cache the
//! HTML across requests.
// Makes README.md's and SECURITY.md's "Zero `unsafe` blocks" a property the
// compiler enforces rather than a claim.
/// Serving content-hashed files out of the embedded `dist` directory.
/// Content-Security-Policy construction and nonce generation.
/// Loading and version-checking the per-route `.ir` modules at startup.
/// The service-worker response and its headers.
/// The HTML page template and the SSR render entry points.
/// Request/response types: page config, manifest, render mode.
/// Re-exported because it appears in [`assets::asset_bytes`]'s signature.
pub use Bytes;
pub use ;
pub use ;
pub use ;
pub use *;