Learn R Programming

servr (version 0.2)

httd: Serve the static files under a directory

Description

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.

Usage

httd(dir = ".", ...)

Arguments

dir
the root directory to serve
...
server configurations passed to server_config()

References

https://github.com/yihui/servr

Examples

Run this code
#' see https://github.com/yihui/servr for command line usage
# or run inside an R session
if (interactive()) servr::httd()

Run the code above in your browser using DataLab