Server side rendering is necessary when dealing with search engines ( SEO: Search engine optimization ).
Client side rendering is great for modern reactive web apps running on consumer devices.
Hybrid rendering combines the best of two worlds and is an absolute killer feature of modern web app frameworks such as Nuxt.
Let's have the BEST of both worlds both with Rust, Actix and Yew!
A simple template for an web application, utilizing Yew for client side rendering with Webassembly ( WASM ), as well as server side rendering ( SSR ).
The webpage rendered by Yew on the server is served with Actix. Actix is an awesome web backend written in Rust and according to benchmarks propably the fastest web backend in existence.
Run ./build-debug.sh for building in debug mode.
Run ./build-production.sh for building in release mode.
-
Install the Rust programming language: https://www.rust-lang.org/tools/install
-
Install your toolchain ( I'am using nightly ):
rustup toolchain install nightly
- Add the target architecture of your web server ( Linux in this example ):
rustup target add x86_64-unknown-linux-gnu
- Add WASM target:
rustup target add wasm32-unknown-unknown
- Install trunk and wasm-bindgen-cli for bundling your WASM code:
cargo install trunk
cargo install wasm-bindgen-cli
- Compile and run the application:
(go to the code base directory )
./build-debug.sh
- Navigate to http://localhost:8080 to view application
- Dr. med. Jan Schiefer janschiefer
- 0.0.1
- Initial Release
This project is licensed under the MIT License - see the LICENSE.md file for details