Try rserve-client for Node.js
-
$ git clone https://github.com/swells/rserve-client-test.git
-
$ cd rserve-client-test
-
$ npm install
> library("Rserve")
> Rserve()
By default Rserve will listen on http://localhost:6311
$ node server.js
Supports both HTTP POST
and GET
Vist http://localhost:8000/eval/{rcode} and include some R Code.
http://localhost:8000/eval/x<-rnorm(10)
or
$ curl -X GET http://localhost:8000/eval/"x<-rnorm(10)"
curl -X POST http://localhost:8000/eval -H "Content-Type: text/plain" --data-binary "@PATH/TO/SCRIPT.R"