rstudio / plumber

Turn your R code into a web API.
https://www.rplumber.io
Other
1.4k stars 256 forks source link

Use httpuv staticPaths #486

Open dernst opened 5 years ago

dernst commented 5 years ago

httpuv somewhat recently added the feature that static files can be served without calling R code. On top of potential performance improvements httpuv also enables HTTP caching directives for static files, so that files don't have to be re-transmitted every time a page is viewed in browser (for example plotly is around 3MB of minified javascript which is.. noticeable).

plumber could be extended with a new slot staticPaths which is a named list specifying which URLs are mapped to local directories (much like @assets does now).

I could probably prepare a pull request if wanted.

schloerke commented 5 years ago

A PR would be great! Thank you!

Bonus request: Have the ability to retrieve all of the files in the static path for path information for OpenApi.