I am a parse user , hoping to switch to backendless and was trying out to save object using nodejs.Here is the script that i have tried out:
exports.run = function ( request, response )
{
var items = [{“product”:“mobile”,“price”:2.76,“quantity”:3}];
var shoppingItem = new ShoppingItem(items,response);
Backendless.Persistence.of( ShoppingItem ).save( shoppingItem, new Backendless.Async(
function( savedOrder )
{
response.send( savedOrder );
}, failureCallback ) );
/* Backendless.Persistence.save( shoppingItem, new Backendless.Async(
function( savedItem )
{
response.send( savedItem);
}, function( fault )
{
response.status( 500 ).send( fault );
response.send( fault );
} ) );/
/ response.send( shoppingItem );*/ //Am getting this object when I run, I guess only save method is not woriking…
};
function ShoppingItem( args,response )
{
args = args || {};
this.___class = ‘ShoppingItem’;
this.product = args[0].product || “”;
this.price = args[0].price || 0.0;
this.quantity = args[0].quantity || 0;
/response.send(args[0].product+"");/
}
Am getting an error:
{“code”:6020,“message”:“Script has timed out before producing a response. Script URL - /repo/web/scripts/hello.js”}
There might be some thing wrong with the code because such a small script cannot throw timed out error.
Can any one help me out?
Thank you for the reply.Yea I have passed the response to the model for debugging.
Iam still getting the same error.Actually there is no problem with object saving, object is getting saved but its not sending the saved item in the response.Am not sure about the issue but may be the call back is not getting triggered…
exports.run = function ( request, response )
{
var item = {“product”:“mobile”,“price”:2.76,“quantity”:3};
The example shopping chart application is working that is not throwing any error.
My custom code is much smaller compared to that. Will such a small script take more than 5 seconds?
Am still getting the same error.But we tried it from different account the code is working.Even the code that I have shared is working.The problem was with my account.I have created the account using mozilla which raised a security alert box saying your details will be viewed by third party.I have cancelled the request even then It logged me in.
Thank you for considering the problem and immediate support.Please look into the problem with sigining up using mozilla.The dashboard also doesn’t work properly in mozilla public url is not getting copied.