The Server class is the parent class for WebServer() and
PipeServer(). This class defines an interface and is not meant to
be instantiated.
See also
WebServer() and PipeServer().
Methods
Method setStaticPath()
Set a static path for the server
Arguments
...Named arguments where each name is the name of the static path and the value is the path to the directory to serve. If there already exists a static path with the same name, it will be replaced.
.listA named list where each name is the name of the static path and the value is the path to the directory to serve. If there already exists a static path with the same name, it will be replaced.
Method setStaticPathOption()
Set one or more static path options
Examples
## ------------------------------------------------
## Method `Server$setStaticPath`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Create a server
server <- WebServer$new("127.0.0.1", 8080, app = my_app)
#' # Set a static path
server$setStaticPath(
staticPath1 = "path/to/static/files",
staticPath2 = "another/path/to/static/files"
)
} # }
## ------------------------------------------------
## Method `Server$removeStaticPath`
## ------------------------------------------------
if (FALSE) { # \dontrun{
# Create a server
server <- WebServer$new("127.0.0.1", 8080, app = my_app)
# Set a static path
server$setStaticPath(
staticPath1 = "path/to/static/files",
staticPath2 = "another/path/to/static/files"
)
# Remove a static path
server$removeStaticPath("staticPath1")
} # }