handler_file: Create Static File Handler

View source: R/server.R

handler_fileR Documentation

Create Static File Handler

Description

Creates an HTTP handler that serves a single file. NNG handles MIME type detection automatically.

Usage

handler_file(path, file, prefix = FALSE)

Arguments

path

URI path to match (e.g., "/favicon.ico").

file

Path to the file to serve.

prefix

[default FALSE] Logical, if TRUE matches path as a prefix.

Value

A handler object for use with http_server().

Examples


h <- handler_file("/favicon.ico", "~/favicon.ico")


nanonext documentation built on March 8, 2026, 9:06 a.m.