pub struct FlowApp { /* private fields */ }Expand description
Full-stack application: pages, layouts, server loads, form submits, and middleware.
Wraps ResumaApp. Call serve with
FlowServeOptions::from_env on Fly.io, Docker, or local dev.
Implementations§
Source§impl FlowApp
impl FlowApp
pub fn new() -> Self
Sourcepub fn static_asset(
self,
path: impl Into<String>,
body: &'static [u8],
content_type: &'static str,
) -> Self
pub fn static_asset( self, path: impl Into<String>, body: &'static [u8], content_type: &'static str, ) -> Self
Serve a fixed byte slice at path (must start with /).
Sourcepub fn client_asset(self, id: impl AsRef<str>, body: &'static [u8]) -> Self
pub fn client_asset(self, id: impl AsRef<str>, body: &'static [u8]) -> Self
Register a TypeScript client component bundle at /static/client/{id}.js.
Sourcepub fn with_extension(
self,
key: impl Into<String>,
value: impl Serialize,
) -> Self
pub fn with_extension( self, key: impl Into<String>, value: impl Serialize, ) -> Self
Attach a JSON-serializable value to every request (req.extension("key") in loads/submits).
Sourcepub fn with_extensions(self, extensions: FlowExtensions) -> Self
pub fn with_extensions(self, extensions: FlowExtensions) -> Self
Merge a map of extensions into every request (e.g. "db": "ready" marker after pool init).
pub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_site_url(self, url: impl Into<String>) -> Self
pub fn with_og_image(self, image: impl Into<String>) -> Self
pub fn with_json_ld(self, json_ld: impl Into<String>) -> Self
Sourcepub fn with_pwa(self, config: FlowPwaConfig) -> Self
pub fn with_pwa(self, config: FlowPwaConfig) -> Self
Enable installable PWA (manifest, service worker, icons) for Android/iOS/desktop.
pub fn with_head(self, head: impl Into<String>) -> Self
pub fn with_stylesheet(self, href: impl Into<String>) -> Self
Sourcepub fn streaming(self, enabled: bool) -> Self
pub fn streaming(self, enabled: bool) -> Self
Enable chunked streaming SSR (head sent before body completes).
Sourcepub fn auto_pages<R>(self, pages_root: impl AsRef<Path>, registry: R) -> Selfwhere
R: FlowPageRegistry + 'static,
pub fn auto_pages<R>(self, pages_root: impl AsRef<Path>, registry: R) -> Selfwhere
R: FlowPageRegistry + 'static,
Register all pages under pages_root using a generated FlowPageRegistry.
pub fn page<F>(self, pattern: &str, handler: F) -> Self
pub fn page_with_layouts<F>( self, pattern: &str, layouts: Vec<String>, handler: F, ) -> Self
pub fn pages_from_registry( self, pages_root: impl AsRef<Path>, registry: Arc<dyn FlowPageRegistry>, ) -> Self
pub async fn serve(self, opts: FlowServeOptions) -> Result<()>
Sourcepub fn into_router(self, opts: FlowServeOptions) -> Router
pub fn into_router(self, opts: FlowServeOptions) -> Router
Build the axum router (pages, Flow routes, static assets, security layers).