Debian Codegraph @

man/handler_file.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/server.R
3 \name{handler_file}
4 \alias{handler_file}
5 \title{Create Static File Handler}
6 \usage{
7 handler_file(path, file, prefix = FALSE)
8 }
9 \arguments{
10 \item{path}{URI path to match (e.g., "/favicon.ico").}
11
12 \item{file}{Path to the file to serve.}
13
14 \item{prefix}{[default FALSE] Logical, if TRUE matches path as a prefix.}
15 }
16 \value{
17 A handler object for use with \code{\link[=http_server]{http_server()}}.
18 }
19 \description{
20 Creates an HTTP handler that serves a single file. NNG handles MIME type
21 detection automatically.
22 }
23 \examples{
24 \dontshow{if (interactive()) withAutoprint(\{ # examplesIf}
25 h <- handler_file("/favicon.ico", "~/favicon.ico")
26 \dontshow{\}) # examplesIf}
27 }