* pass context providers into server functions * add an example for FromContext * clean up DioxusRouterExt * fix server function context * fix fullstack desktop example * fix axum auth example * fix fullstack context type * fix context providers path
28 lines
556 B
Rust
28 lines
556 B
Rust
// Run with:
|
|
// ```bash
|
|
// cargo run --bin server --features server
|
|
// ```
|
|
|
|
use axum_desktop::*;
|
|
use dioxus::prelude::*;
|
|
use server_fn::axum::register_explicit;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let listener = tokio::net::TcpListener::bind("127.0.0.01:8080")
|
|
.await
|
|
.unwrap();
|
|
|
|
register_explicit::<PostServerData>();
|
|
register_explicit::<GetServerData>();
|
|
|
|
axum::serve(
|
|
listener,
|
|
axum::Router::new()
|
|
.register_server_functions()
|
|
.into_make_service(),
|
|
)
|
|
.await
|
|
.unwrap();
|
|
}
|