flowhub / jsjob

Run arbitrary JavaScript code as jobs, in a browser-based sandbox.
MIT License
18 stars 0 forks source link

Allow hosting job scripts #41

Open jonnor opened 6 years ago

jonnor commented 6 years ago

Right now the consumer must ensure that .jsjob scripts are available at the specified HTTP(s). This is a bit tedious when one just wants to provide something locally. Should be able to specify a mapping of hosted scripts, and let the Runner serve them via its existing HTTP server.

var options = {
   hostJobs: {
     'path-to-expose-on': fileContents,
     ...
   }
}
var runner = new Runner(options);
runner.runJob('path-to-expose-on', ...

The CLI tool should then use this functionality when there is no protocol specified for the .jsjob URL