build creates the Plumber-router and
run starts the service.
build(
repo_dir,
url_path,
redirect_url,
title,
description,
contact,
license,
tos
)run(pr, host = "127.0.0.1", port = 1881, url_path, ...)
A new Plumber-router object.
Path to local directory, where the root of the repository is.
The (source) packages will be stored locally at
{repo_dir}/src/contrib/.
Optional prefix to endpoint. The CRAN repository will be
available at e.g. http://127.0.0.1:port/path_prefix/ with the
"contrib.url" as http://127.0.0.1:port/path_prefix/src/contrib/.
Url, if supplied, requests to static assets (package files, etc.) are redirected to another service instead of being handled by cran_static_path_handler. It can be beneficial to let e.g. an Apache httpd service handle those.
Descriptions of the API. Some defaults are used, see section below or https://www.rplumber.io/articles/annotations.html.
A Plumber-router, e.g. as returned from
build.
A string that is a valid IPv4 or IPv6 address that is owned by this server, which the application will listen on. "0.0.0.0" represents all IPv4 addresses and "::/0" represents all IPv6 addresses.
A number or integer that indicates the server port that should be listened on. Note that on most Unix-like systems including Linux and Mac OS X, port numbers smaller than 1025 require root privileges.
Additional arguments passed on to plumber::pr_run().
Logical, should the method run the site immediately?
The fields title, description, contact, license, and tos
are used for describing the API in the resulting Swagger-documents.
These follow the OpenAPI type descriptions, see
https://spec.openapis.org/oas/v3.0.3#info-object.
| Field name | Type | Description |
| title | string | The title of the API. |
| description | string | A short description of the API. |
| tos | string | A URL to the Terms of Service for the API. |
| contact | list | A "Contact Object", i.e., list-object with fields "name", "url" and "email". |
| license | list | A "License Object", i.e., list-object with fields "name" and "url". |
| version | string | The version of the API. |
Point repo_dir to you local filesystem. If the (sub-)directory does not
exist, it will be created when an R-package is added through the corresponding
endpoint.