| Title: | Live Reload for Plumber APIs |
|---|---|
| Description: | Enhances development for plumber APIs by enabling live reloading. Monitors API files for changes and automatically refreshes the server and connected web clients, allowing for faster API iteration. |
| Authors: | Elian Thiele-Evans [aut, cre] (ORCID: <https://orcid.org/0000-0001-8008-3165>) |
| Maintainer: | Elian Thiele-Evans <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9003 |
| Built: | 2026-06-02 10:46:38 UTC |
| Source: | https://github.com/ElianHugh/hotwater |
Following install_hotwater(), the hotwater command can be used
to run a hotwater engine straight from the terminal. See
run() for further details on default values.
hotwater -v will provide the current version of hotwater.
hotwater -h will provide help text.
-f |
plumber file |
-d |
extra directories |
-p |
plumber port |
-h |
show help |
--host |
plumber host |
# ```sh # hotwater -f path/to/app.R -p 9999 # ```# ```sh # hotwater -f path/to/app.R -p 9999 # ```
If hotwater is installed, users may run hotwater from the command line
rather than from an R terminal.
install_hotwater(install_folder)install_hotwater(install_folder)
install_folder |
folder to install hotwater
script into. To run as expected, make sure that the folder supplied is on your
|
hotwater::install_hotwater()hotwater::install_hotwater()
Start the hotwater engine, launching a plumber API that is restarted whenever a file in the plumber API's folder is modified.
Extra directories can be specified to refresh the API when directories other than the plumber folder are modified.
If a plumber endpoint returns an HTML response, when hotwater refreshes the API, {hotwater} will also order a refresh of any webpage that is using the API.
run(path, dirs = NULL, port = NULL, host = NULL, ignore = NULL)run(path, dirs = NULL, port = NULL, host = NULL, ignore = NULL)
path |
path to plumber API file. |
dirs |
(optional) a character vector of extra directories to watch for file changes. Paths are resolved from the current working directory, not the directory of the plumber API file. |
port |
port to launch API on. If NULL, defaults to the |
host |
host to launch API on. If NULL, defaults to the |
ignore |
vector of file globs to ignore. If NULL, defaults to |
To refresh the browser, a postserialize plumber::pr_hook is used to inject a websocket into the HTML client that listens for the plumber server refresh.
plumber::options_plumber, plumber::get_option_or_env, plumber::serializer_html
# start a hotwater session on port 9999 hotwater::run( path = system.file("examples", "plumber.R", package = "hotwater"), port = 9999L )# start a hotwater session on port 9999 hotwater::run( path = system.file("examples", "plumber.R", package = "hotwater"), port = 9999L )
Uninstall global hotwater script
uninstall_hotwater(install_folder)uninstall_hotwater(install_folder)
install_folder |
folder to uninstall hotwater from. |
hotwater::uninstall_hotwater()hotwater::uninstall_hotwater()