Skip to main content

serve

Function serve 

Source
pub fn serve<F>(serve_it: impl FnMut() -> F) -> !
where F: Future<Output = Result<Router, Error>> + 'static,
Available on non-WebAssembly only.
Expand description

Serve a fullstack dioxus application with a custom axum router.

This function sets up an async runtime, enables the default dioxus logger, runs the provided initializer, and then starts an axum server with the returned router.

The axum router will be bound to the address specified by the IP and PORT environment variables, defaulting to 127.0.0.1:8080 if not set.

This function uses axum to block on serving the application, and will not return.