report_route | R Documentation |
This route allows you to serve a report written as a Quarto/Rmarkdown
document. The report will be rendered on demand using the query params as
parameters for the report if they match. Depending on the value of the value
of max_age
the rendered report is kept and served without a re-render on
subsequent requests. The rendering can happen asynchronously in which case
a promise is returned.
report_route(
path,
file,
...,
max_age = Inf,
async = TRUE,
finalize = NULL,
continue = FALSE,
ignore_trailing_slash = FALSE
)
path |
The url path to serve the report from |
file |
The quarto or rmarkdown file to use for rendering of the report |
... |
Further arguments to |
max_age |
The maximum age in seconds to keep a rendered report before initiating a re-render |
async |
Should rendering happen asynchronously (using mirai) |
finalize |
An optional function to run before sending the response back.
The function will receive the request as the first argument, the response as
the second, and anything passed on through |
continue |
A logical that defines whether the response is returned directly after rendering or should be made available to subsequent routes |
ignore_trailing_slash |
Should |
Only the formats explicitely stated in the header of the report are allowed and the will be selected through content negotiation. That means that if multiple formats produces the same file type, only the first will be available. If no format is specified the default for both Quarto and Rmarkdown documents is HTML
A route object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.