How to add custom (in the form of a string) R function to openCPU (running as a local server) library using openCPU JavaScript API or jQuery?
Using something like
var myfunc = "ff <- function(x,y) { x+y }";
$.post("http://localhost:8483/R/call/base/identity/save",
{x : myfunc},
function(res) {...});
yields the following error in the browser
Cross-Origin Request Blocked: The Same Origin Policy disallows
reading the remote resource at http://localhost:8483/R/call
/base/identity/save. (Reason: CORS header 'Access-Control-Allow-
Origin' missing)