This example creates a basic todo app with an Actix backend that uses Leptos' server functions to call sqlx from the client and seamlessly run it on the server. It is identical to the todo-app-sqlite example, but utilizes CBOR encoding for one of the server functions
To run it as a server side app with hydration, first you should run
wasm-pack build --target=web --no-default-features --features=hydrate
to generate the WebAssembly to hydrate the HTML that is generated on the server.
Then run the server with cargo run
to serve the server side rendered HTML and the WASM bundle for hydration.
cargo run --no-default-features --features=ssr
Note that if your hydration code changes, you will have to rerun the wasm-pack command above This should be temporary, and vastly improve once cargo-leptos becomes ready for prime time!