Rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shCargo-Leptos
cargo install cargo-leptos --lockedrustup toolchain install nightly --allow-downgrade- make sure you have Rust nightlyrustup target add wasm32-unknown-unknown- add the ability to compile Rust to WebAssembly
cargo leptos build --releaseWill generate your server binary in target/release and your site package in target/site
After running a cargo leptos build --release the minimum files needed are:
- The server binary located in
target/server/release - The
sitedirectory and all files within located intarget/site
Set the following environment variables (updating for your project as needed):
export LEPTOS_OUTPUT_NAME="eofapps"
export LEPTOS_SITE_ROOT="site"
export LEPTOS_SITE_PKG_DIR="pkg"
export LEPTOS_SITE_ADDR="127.0.0.1:3000"
export LEPTOS_RELOAD_PORT="3001"Finally, run the server binary.
This template itself is released under the Unlicense. You should replace the LICENSE for your own application with an appropriate license if you plan to release it publicly.