Add auto-reload example (#2166)

This commit is contained in:
Jonas Platte
2023-09-11 13:56:47 +02:00
committed by GitHub
parent 998ef8dc89
commit 3f5c907e2d
3 changed files with 59 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
# auto-reload
This example shows how you can set up a development environment for your axum
service such that whenever the source code changes, the app is recompiled and
restarted. It uses `listenfd` to be able to migrate connections from an old
version of the app to a newly-compiled version.
## Setup
```sh
cargo install cargo-watch systemfd
```
## Running
```sh
systemfd --no-pid -s http::3000 -- cargo watch -x run
```