| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/httpd.R |
| 3 |
\name{serve_dir} |
| 4 |
\alias{serve_dir} |
| 5 |
\title{Serve a static directory} |
| 6 |
\usage{ |
| 7 |
serve_dir(dir = ".", name = "xfun-dir", ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{dir}{The directory to serve.} |
| 11 |
|
| 12 |
\item{name}{The app name passed to \code{\link[=new_app]{new_app()}}. Use \code{''} to serve the |
| 13 |
directory at the root URL via the proxy.} |
| 14 |
|
| 15 |
\item{...}{Other arguments passed to \code{\link[=new_app]{new_app()}}.} |
| 16 |
} |
| 17 |
\value{ |
| 18 |
The app URL, returned invisibly. |
| 19 |
} |
| 20 |
\description{ |
| 21 |
Serve a directory of files via \code{\link[=new_app]{new_app()}}. If \code{index.html} exists under the |
| 22 |
directory, it is shown; otherwise a directory listing is shown. This is |
| 23 |
similar to \code{servr::httd()} and Python's \code{http.server} module. |
| 24 |
} |
| 25 |
\examples{\dontshow{if (interactive()) \{} |
| 26 |
xfun::serve_dir(tempdir()) |
| 27 |
\dontshow{\}} |
| 28 |
} |