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/server/README.md
2025-04-04 08:28:07 +02:00

1.3 KiB
Raw Permalink Blame History

Calendar Server Example

A simple Rust web server using Hyper that exposes an /all_calendars endpoint.

Running the server

# 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:

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:

Step 1: Install cargo-watch

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'