dioxus-server 0.7.0-alpha.3

Fullstack utilities for Dioxus: Build fullstack web, desktop, and mobile apps with a single codebase.
docs.rs failed to build dioxus-server-0.7.0-alpha.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Dioxus utilities for the Axum server framework.

Example

#![allow(non_snake_case)]
use dioxus::prelude::*;

fn main() {
    #[cfg(feature = "web")]
    // Hydrate the application on the client
    dioxus::launch(app);
    #[cfg(feature = "server")]
    {
        tokio::runtime::Runtime::new()
            .unwrap()
            .block_on(async move {
                // Get the address the server should run on. If the CLI is running, the CLI proxies fullstack into the main address
                // and we use the generated address the CLI gives us
                let address = dioxus::cli_config::fullstack_address_or_localhost();
                let listener = tokio::net::TcpListener::bind(address)
                    .await
                    .unwrap();
                axum::serve(
                        listener,
                        axum::Router::new()
                            // Server side render the application, serve static assets, and register server functions
                            .serve_dioxus_application(ServeConfigBuilder::default(), app)
                            .into_make_service(),
                    )
                    .await
                    .unwrap();
            });
     }
}

fn app() -> Element {
    let mut text = use_signal(|| "Click the button to run a server function".to_string());

    rsx! {
        button {
            onclick: move |_| async move {
                if let Ok(data) = get_server_data().await {
                    text.set(data);
                }
            },
            "Run a server function"
        }
        "Server said: {text}"
    }
}

#[server(GetServerData)]
async fn get_server_data() -> ServerFnResult<String> {
    Ok("Hello from the server!".to_string())
}