launch() function starts a fullstack Dioxus application with integrated server-side rendering, client hydration, and automatic server function registration.
Basic Usage
- Creates an Axum web server
- Registers all server functions
- Sets up SSR rendering
- Serves static assets
- Enables hot-reloading in debug mode
Configuration
For advanced configuration, useserve() with a custom router:
Launch Functions
launch()
root: Component function to render
packages/fullstack-server/src/launch.rs:38
Example:
serve()
serve_it: Closure returning aFuture<Router>
packages/fullstack-server/src/launch.rs:115
Example:
router()
app: Component function to render
axum::Router
Location: packages/fullstack-server/src/launch.rs:96
Example:
serve_router()
serve_callback: Function returning a newRouter(called on hot-reload)addr: Socket address to bind
packages/fullstack-server/src/launch.rs:134
Example:
ServeConfig
TheServeConfig type configures server-side rendering behavior.
Methods
new()
builder()
ServeConfigBuilder
Builder for customizing server configuration.Methods
enable_out_of_order_streaming()
incremental()
context_providers()
Environment Configuration
The server address and port can be configured via environment variables:IP: Server IP address (default:127.0.0.1)PORT: Server port (default:8080)
Feature Flags
The fullstack launch requires theserver feature:
Hot-Reloading
In debug mode, the server automatically:- Watches for file changes
- Applies hot-patches to running code
- Recreates the router on code changes
- Resets renderer state
Router Extension Methods
TheDioxusRouterExt trait adds Dioxus-specific methods to Axum routers:
serve_dioxus_application()
- Server function registration
- Static asset serving
- SSR rendering handler
- WebSocket for hot-reload and devtools