From b25e6ee17ba07e59fbb711ea0362b9292f7b373e Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Tue, 24 Nov 2020 21:07:20 +0000 Subject: [PATCH] add back page about auto reloading For folks finding this page via search engines, there was still info regarding listenfd and systemfd which is no longer recommended. --- content/docs/autoreload.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 content/docs/autoreload.md diff --git a/content/docs/autoreload.md b/content/docs/autoreload.md new file mode 100644 index 0000000..b1388be --- /dev/null +++ b/content/docs/autoreload.md @@ -0,0 +1,22 @@ +--- +title: Autoreloading +menu: docs_patterns +weight: 1000 +--- + +# Auto-Reloading Development Server + +During development it can be very handy to have cargo automatically recompile the code on change. +This can be accomplished very easily by using [cargo-watch][cargowatch]. + +```sh +cargo watch -x 'run --bin app' +``` + +## Historical Note + +An old version of this page recommended using a combination of systemfd and listenfd, but this has +many gotchas and was difficult to integrate properly, especially when part of a broader development +workflow. We consider [`cargo-watch`] to be sufficient for auto-reloading purposes. + +[`cargo-watch`]: https://github.com/passcod/cargo-watch