Skip to content

Files

Latest commit

b5e2d30 · Oct 25, 2024

History

History

hot_reload_tide

A hot reloading web server

Imagine this is a web app that remembers information about audio messages. It has a configuration file that acts as a database, you can edit the configuration and the app will pick up changes without the need to restart it.

You can use this concept to make your hot-reloading web servers. It uses a mutex under an atomic reference counted pointer to guarantee that the config won't be read and written to at the same time. To learn about how that works, please check out the Fearless Concurrency chapter of the Rust book.

To try the app, please run

cargo run

open this link in your browser, then try editing the config.json file and reload the browser. You should see the response in your browser reflect the latest changes without restarting the app.