new Code() → {Object}
creates and returns a Code object that can be used to execute ClearBlade Code Services
- Source:
Returns:
ClearBlade.Code
- Type
- Object
Methods
execute(name, params, callback)
Executes a ClearBlade Code Service
Parameters:
| Name | Type | Description |
|---|---|---|
name |
String | name of the ClearBlade service |
params |
Object | object containing parameters to be used in service |
callback |
function |
- Source:
Example
cb.Code().execute("ServiceName", {stringParam: "stringVal", numParam: 1, objParam: {"key": "val"}, arrayParam: ["ClearBlade", "is", "awesome"]}, function(err, body) {
if(err) {
//handle error
} else {
console.log(body);
}
})