MazamaScience/beakr

Additional examples/tests

Closed this issue · 1 comments

We need to have examples (at least in local_examples/) that demonstrate how to use beakr as a replacement for jug in our existing web services. By far the most common use case is to attach functions to URL paths. The functions will typically:

  • accept req, res, err
  • extract parameters from a browser initiated GET request
  • if not already found in a cache directory: 1) run a bunch of R code; and 2) write a file to disk
  • read a file from disk
  • return one of: 1) a blob of json with the file URL; or 2) the file itself

File types that we currently serve include:

  • json
  • text
  • csv
  • pdf
  • png
  • html

But we want to be able to serve up just about anything along with the proper mime type. (See the mime package.)

hmrtn commented

demonstrated in test_Repeater_beakr.R.