Skip to main content

Module server

Module server 

Source
Expand description

Server-side (Axum) routes for crawler-facing endpoints.

Available behind the server feature. These are plain Axum routes, not server functions: a server function JSON-encodes its String return value (quoted body, application/json content type), which robots.txt / sitemap / llms.txt consumers can’t parse.

§Example

dioxus::server::serve(|| async {
    let seo = SeoRouter::new("https://example.com", "My Docs", "Documentation for My Product")
        .with_docs(&DOCS, "/docs")
        .with_blog(&BLOG, "/blog")
        .into_router();
    Ok(dioxus::server::router(App).merge(seo))
});

Structs§

SeoRouter
Builder for the crawler-facing routes of a docs/blog site.