Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Define the Cloud Code "yodaSpeakFunction" and initialize/call the Cloud Module "yodaSpeak"
// Cloud Code 'yodaSpeakFunction'
// Import Cloud Module from /cloud folder
// Initialize Cloud Code with your Mashape key (http://mashape.com/keys)
var yodaClient = require('cloud/yoda-1.0.0.js');
yodaClient.initialize('<Enter your Mashape key here>');
Parse.Cloud.define("yodaSpeakFunction", function(request, response) {
// Call 'yodaSpeak' Cloud Module passing in 'sentence' parameter
// Please refer to https://www.mashape.com/ismaelc/yoda-speak for parameter details
yodaClient.yodaSpeak({
sentence: request.params.sentence
},
{
success: function(httpResponse) {
console.log(httpResponse);
response.success(httpResponse.text);
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.