Skip to contents

Installs freshwater defaults onto a plumber2 API.

This is a convenience wrapper:

  • Registers freshwater's HTML serialiser

  • Installs freshwater request context

  • Optionally enables CSRF protection

  • Optionally installs HTML error page handlers

Arguments in ... are selectively forwarded to api_csrf(), api_error_pages(), and register_html_serialiser based on matching formal parameters.

Usage

api_freshwater(api, csrf = TRUE, error_pages = TRUE, ...)

Arguments

api

a plumber2::plumber2 api object.

csrf

whether to enable CSRF protection

error_pages

whether to enable error pages

...

args passed to either api_csrf() or api_error_pages()