This question is locked. New answers and comments are not allowed.
I am new to Telerik platform backend services. I am trying to access cloud data in cloud function using Everlive.Sdk. I followed the Api Using Javascript Sdk in telerik documentation to get data. Everything is working fine without any error but instead of getting data I get blank response (like this: {}) when I Execute the cloud function. I added console.log statements in my code but I noticed that callback function in Everlive.Sdk.$.data(null, function(error, data)){} was not called. My code is as followed:
Everlive.CloudFunction.onRequest(
function
(request, response, done){
console.log(
"onrequest called.."
);
Everlive.Sdk.$.data(
'questions'
).get(
null
,
// filter
function
(error, data) {
console.log(
"in callback function..."
);
if
(error) {
console.log(
"in error..."
);
// When using cloud functions you need to set the result like so:
response.body = error;
response.statusCode = 500;
}
else
{
console.log(
"in success.."
);
// When using cloud functions you need to set the result like so:
response.body = JSON.stringify(data.result);
}
done();
});
done();
});
Please help me with this, I am kind of stucked here. Let me know what I am missing.
Thanks & Regards
Arpita