Creates a JSON-serialisable list describing all available API endpoints.
Used to generate index.json at the API root.
Usage
generate_api_index(
base_url = "https://johngavin.github.io/irishbuoys/api/v1/",
endpoints = NULL
)
Arguments
- base_url
Character, base URL for the API
(default: "https://johngavin.github.io/irishbuoys/api/v1/")
- endpoints
Named list of endpoint metadata. Each element should have
description and optionally fields. If NULL, uses default endpoints.
See also
Other api:
api_plumber,
api_static,
create_api_router(),
generate_api_decomposition(),
generate_api_extremes(),
generate_api_gust_factors(),
generate_api_latest(),
generate_api_methods(),
generate_api_sources(),
generate_api_spatial(),
generate_api_status(),
generate_api_trends(),
run_api()
Examples
if (FALSE) { # \dontrun{
idx <- generate_api_index()
jsonlite::toJSON(idx, pretty = TRUE, auto_unbox = TRUE)
} # }