Hi,
I have tried the Example given in https://wiki.dreamfactory.com/DreamFactory/Tutorials/V8_custom_scripting_service
and I invoked this request through postman Chrome Extension. please find the details below.
Custom Code:
var lodash = require(“lodash.min.js”);
if (event.request.method !== “GET”) {
throw(“Only HTTP GET is allowed on this endpoint.”);
}
var params = event.request.parameters;
// check for required params
var required = [“n1”,“n2”];
lodash._.each( required, function( element ) {
if (!params.hasOwnProperty(element) || !params[element]) {
throw( “Missing '” + element + “’ in params\n” );
}
});
var result = Number(params.n1) + Number(params.n2);
return result;
Requested URL:
I get the following response.
“error”: {
“context”: null,
“message”: “The module “lodash” could not be found in any known locations.”,
“code”: 500,
I checked the Dream Factory logs i found the following.
[2015-11-26 19:13:09] local.DEBUG: Service event: add.get.pre_process
[2015-11-26 19:13:09] local.DEBUG: * no “require()” support in V8 library v3.17.15
Please help me about how to resolve this
Regards,
K R Sreenivas Harshith.