docsite icon indicating copy to clipboard operation
docsite copied to clipboard

Using ServerFn in dioxus_desktop

Open MassiminoilTrace opened this issue 1 year ago • 2 comments

I've tried the dioxus_fullstack example. As far as I understood it has an underlying axum server, which serves both the static files and the generated APIs made by ServerFn.

Is it possible to separate them for use in dioxus_desktop?

I imagine something like:

  • dioxus_desktop runs a compiled binary (spawns a webview anyway)
  • dioxus (ssr) runs server-side axum, serving only the APIs without the web static files
  • they talk over the network

I tried to search in the documentation and examples by I haven't found anything so far

MassiminoilTrace avatar Oct 15 '23 20:10 MassiminoilTrace

Yes! You can have an Axum server with a desktop/tui/native/mobile application with server functions. There is an example here.

It would be great to add a small section in the docs explaining how to use dioxus-fullstack with desktop

ealmloff avatar Oct 15 '23 20:10 ealmloff

Thanks

I can try to add the section to the docs, after I get a bit more acquainted

MassiminoilTrace avatar Oct 15 '23 22:10 MassiminoilTrace