This repository has been archived on 2025-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
rhaj/components/website/README.md
2025-04-04 08:28:07 +02:00

51 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Calendar Server Example
A simple Rust web server using Hyper that exposes an `/all_calendars` endpoint.
## Running the server
```bash
# Navigate to the examples directory
cd /path/to/examples
# Build and run the server
cargo run
```
Once the server is running, you can access the endpoint at:
- http://127.0.0.1:8080/all_calendars
## Features
- Simple HTTP server using Hyper
- Single endpoint that returns "Hello World"
Sure thing! Heres the Markdown version you can copy-paste directly into your README.md:
## 🔁 Live Reload (Hot Reload for Development)
To automatically recompile and restart your example server on file changes (e.g. Rust code, templates, Rhai scripts), you can use [`cargo-watch`](https://github.com/watchexec/cargo-watch):
### ✅ Step 1: Install `cargo-watch`
```bash
cargo install cargo-watch
```
### ✅ Step 2: Run the server with live reload
cargo watch -x 'run --example server'
This will:
• Watch for file changes in your project
• Rebuild and re-run examples/server.rs whenever you make a change
### 🧠 Bonus: Watch additional folders
To also reload when .tera templates or .rhai scripts change:
cargo watch -w src -w examples -w src/templates -w src/scripts -x 'run --example server'
### 💡 Optional: Clear terminal on each reload
cargo watch -c -x 'run --example server'