A skeleton project to start a new Yew web single page app (SPA)
Everytime I create new project with Yew web framework, it always ended up at this state no matter what
To build wasm file, we will need rust, wasm-pack, wasm-bindgen-cli, wasm-opt
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shInstall wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | shInstall wasm-bindgen-cli
cargo install -f wasm-bindgen-cliInstall wasm-opt, it's lies under binaryen package
sudo pacman -S binaryenJust simple run the build_wasm.sh file
sh build_wasm.shAfter the wasm are built, run the server with
cargo run --release
We can change the IP and port in the file config.toml
I use Bulma because I got familiar with it
The server can be anything, I just use actix-web because I got familiar with it
It needs to have 3 basic GET routes to serve the web
/static- serve files inweb/static//wasm- serve files inweb/pkg, which is wasm file when they built*- any other route will point to theweb/index.htmlfile, theyew-routerin the frontend will handle the rest