Today I attempted to execute Parse cloud code from an AngularJS app for the very first time. Upon doing so, I encountered a Parse.Error 'unauthorized' message in my console.log. Despite having initialized Parse in my application and JS keys, I seem to be missing something crucial. Can anyone pinpoint where I may be going wrong?
Here is the format of my Angular code:
$scope.runSomething = function () {
Parse.Cloud.run('nameFunction', req.body, {
success: function (result){
},
error: function (error){
console.log(error);
}
})
In the $scope.runSomething function, I obtain the req.body needed for the Parse.Cloud.run call.
Below is a snippet from my main.js file:
Parse.Cloud.define('nameFunction', function(request, response){
Parse.Cloud.useMasterKey();
//Do Stuff})
Though I am certain that I must be overlooking a minor detail, I cannot figure out what it is.