Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxidbr9/rust-react-ssr-example
SSR React app using Rust as a Backend
https://github.com/xxidbr9/rust-react-ssr-example
react rust ssr
Last synced: about 1 month ago
JSON representation
SSR React app using Rust as a Backend
- Host: GitHub
- URL: https://github.com/xxidbr9/rust-react-ssr-example
- Owner: xxidbr9
- Created: 2022-10-02T08:28:40.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-14T16:14:59.000Z (about 2 years ago)
- Last Synced: 2024-10-03T18:16:05.433Z (about 2 months ago)
- Topics: react, rust, ssr
- Language: Rust
- Homepage: https://example-rust-react-ssr-v8.onrender.com/
- Size: 244 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rust + React = SSR
Simple example running React in SSR using Rust as a backendLearn V8 from [here](https://github.com/denoland/rusty_v8/blob/main/examples/hello_world.rs)
## Preparation
- First make sure you install [Rust](https://www.rust-lang.org/)
- And install LLVM & Clang## How To Run
Before running the server, it required to build the frontend project
```bash
# Go to target directory
cd examples/source# Install using yarn
yarn# Build all required files
yarn build:all# Back to root project
cd ../../
``````bash
# serve with actix web server
# Using V8
cargo build --example=actix-v8 --release# Using JSC
cargo build --example=actix-jsc --release
``````bash
# Serve the example
# V8
cargo run --example=actix-v8 --release# JSC
cargo build --example=actix-jsc --release
```See the serve in JSC : [http://localhost:8081](http://localhost:8081)
See the serve in V8 : [http://localhost:8082](http://localhost:8082)
## TODO
- [ ] Babel transformer => using same api in Next.js
- [ ] Benchmarking and compare with Next.js
- [ ] Using [JSC](https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore)
- [ ] Fix JSC ```[Object Module]```