Make it easier to provide context to fullstack (#2515)

* 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
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-06-18 20:38:06 -05:00
1 parent 7ee3dc41fc
commit b0caf442ab
12 files changed
+152 -64

No files matched your search

@@ -49,9 +49,7 @@ fn main() {
// build our application with some routes
let app = Router::new()
// Server side render the application, serve static assets, and register server functions
.serve_dioxus_application(ServeConfig::builder().build(), || {
VirtualDom::new(app)
})
.serve_dioxus_application(ServeConfig::default(), app)
.await
.layer(
axum_session_auth::AuthSessionLayer::<
@@ -19,7 +19,7 @@ async fn main() {
axum::serve(
listener,
axum::Router::new()
.register_server_fns()
.register_server_functions()
.into_make_service(),
)
.await