batchdb-web-api
expose the batchdb api as an http endpoint
example
var batchdb = ;var db = '/tmp/compute.db';var compute = ;var http = ;var api = compute;compute;var server = http;server;
methods
var webapi =
var api = webapi(compute, opts)
Create a batchdb http handler instance api
from a
batchdb instance compute
.
You can pass in an opts.prefix
string to mount the routes at a prefix.
var m = api.exec(req, res)
If the request matches, handle the request and return the match.
var m = api.match(req.url)
Compute whether the http request url string req.url
should be handled
routes
These routes are handled by the web api:
/create
- create a job from the contents of the POST body/list/job
- list the jobs/list/pending
- list the pending instances/list/result
- list results/blob/:id
- fetch job or result blob content by its id
install
With npm do:
npm install batchdb-web-api
license
MIT