httd | R Documentation |
If there is an ‘index.html’ under this directory, it will be displayed; otherwise the list of files is displayed, with links on their names. After we run this function, we can go to ‘http://localhost:port’ to browse the web pages either created from R or read from HTML files.
httd(dir = ".", ...)
httw(
dir = ".",
watch = ".",
pattern = NULL,
all_files = FALSE,
filter = NULL,
handler = NULL,
...
)
dir |
The root directory to serve. |
... |
server configurations passed to |
watch |
a directory under which |
pattern |
a regular expression passed to |
all_files |
whether to watch all files including the hidden files |
filter |
a function to filter the file paths returned from
|
handler |
a function to be called every time any files are changed or added under the directory; its argument is a character vector of the filenames of the files modified or added |
httd()
is a pure static server, and httw()
is similar but
watches for changes under the directory: if an HTML file is being viewed in
the browser, and any files are modified under the directory, the HTML page
will be automatically refreshed.
https://github.com/yihui/servr
servr::httd()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.