serve_dir: Serve a static directory

View source: R/httpd.R

serve_dirR Documentation

Serve a static directory

Description

Serve a directory of files via new_app(). If index.html exists under the directory, it is shown; otherwise a directory listing is shown. This is similar to servr::httd() and Python's http.server module.

Usage

serve_dir(dir = ".", name = "xfun-dir", ...)

Arguments

dir

The directory to serve.

name

The app name passed to new_app(). Use '' to serve the directory at the root URL via the proxy.

...

Other arguments passed to new_app().

Value

The app URL, returned invisibly.

Examples


xfun::serve_dir(tempdir())


xfun documentation built on June 19, 2026, 9:06 a.m.