The server functions in this package are configured through this function.
server_config(dir = ".", host = "127.0.0.1", port, browser, daemon, interval = 1,
baseurl = "", initpath = "")
the root directory to serve
A string that is a valid IPv4 address that is owned by this
server, or "0.0.0.0"
to listen on all IP addresses.
the TCP port number; by default it is 4321
or a random
port if 4321
is not available, unless a command line argument of the
form -pNNNN
(N is a digit from 0 to 9) was passed in when R was
launched, in which case NNNN
will be used as the port number
whether to launch the default web browser; by default, it is
TRUE
if the R session is interactive()
, or when a
command line argument -b
was passed to R (see
commandArgs()
); N.B. the RStudio viewer is used as the web
browser if available
whether to launch a daemonized server (the server does not
block the current R session) or a blocking server; by default, it is the
global option getOption('servr.daemon')
(e.g., you can set
options(servr.daemon = TRUE)
); if this option was not set,
daemon = TRUE
if a command line argument -d
was passed to R
(through Rscript
); normally it should be FALSE
by default
the time interval used to check if an HTML page needs to be
rebuilt (by default, it is checked every second); at the moment, the
smallest possible interval
is set to be 1, and this may change in
the future
the base URL (the full URL will be
http://host:port/baseurl
)
the initial path in the URL (e.g. you can open a specific HTML file initially)
A list of configuration information of the form list(host,
port, start_server = function(app) {}, ...)
.