Auto-build the fronted into the release binary on cargo build --release
This commit is contained in:
18
README.md
18
README.md
@@ -3,30 +3,28 @@
|
||||
This app runs as a single Rust web server binary that serves the Vite/React frontend and exposes APIs.
|
||||
The frontend lives in the `frontend/` directory.
|
||||
|
||||
You can also run the frontend and backend separately in development (Vite dev server + Rust API).
|
||||
|
||||
## Running it in development
|
||||
|
||||
```bash
|
||||
# Build the frontend
|
||||
cd frontend
|
||||
pnpm install
|
||||
pnpm build
|
||||
cd ..
|
||||
pnpm install
|
||||
pnpm dev
|
||||
|
||||
# Run the server (serves embedded frontend/dist/)
|
||||
cargo run
|
||||
```
|
||||
|
||||
## Running it in production
|
||||
## Production
|
||||
|
||||
```bash
|
||||
# Build the frontend
|
||||
cd frontend
|
||||
pnpm install
|
||||
pnpm build
|
||||
cd ..
|
||||
# Build the release binary (also builds the frontend via build.rs)
|
||||
cargo build --release
|
||||
|
||||
# Run the server (serves embedded frontend/dist/)
|
||||
cargo run
|
||||
./target/release/story-kit-server
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user