% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/httpd.R
\name{serve_dir}
\alias{serve_dir}
\title{Serve a static directory}
\usage{
serve_dir(dir = ".", name = "xfun-dir", ...)
}
\arguments{
\item{dir}{The directory to serve.}

\item{name}{The app name passed to \code{\link[=new_app]{new_app()}}. Use \code{''} to serve the
directory at the root URL via the proxy.}

\item{...}{Other arguments passed to \code{\link[=new_app]{new_app()}}.}
}
\value{
The app URL, returned invisibly.
}
\description{
Serve a directory of files via \code{\link[=new_app]{new_app()}}. If \code{index.html} exists under the
directory, it is shown; otherwise a directory listing is shown. This is
similar to \code{servr::httd()} and Python's \code{http.server} module.
}
\examples{\dontshow{if (interactive()) \{}
xfun::serve_dir(tempdir())
\dontshow{\}}
}
