How to integrate Mashape APIs with Parse as Cloud Modules @ParseIt Posted 4 months ago
Photo credit: Parse
Parse is a backend-as-a-service (BAAS) platform that lets you focus on building your applications without worrying about server and infrastructure maintenance and complexities. If you haven’t heard or tried Parse before, I encourage you to try their Quickstart here to get an idea of how the BAAS paradigm works.
This post shows an example of a Mashape API integrated with Parse through Parse Modules. Parse Modules are libraries that Parse developers import into their app to use certain functionality offered by 3rd-party APIs. Once your API is turned into a Parse Module, it will be easier for developers to use it in their applications.
There’s a whole tutorial from the Parse documentation that shows how to turn your APIs into Cloud Modules, so we won’t go through those steps. Instead we will show a finished working code here, that you can use to pattern your Modules after. (It is however essential to have an understanding of how Cloud Code and Cloud Modules work, so reading them first would be great).
Let’s get started!
2. Define the Cloud Code “yodaSpeakFunction” (main.js in the /cloud folder) and initialize/call the Cloud Module “yodaSpeak”:
3. The Cloud Module “yodaSpeak” (yoda-1.0.0.js in the /cloud folder) where the Mashape API is called
Our Parse Cloud Module ‘yoda-1.0.0.js' is now finished! You can drop it in your own Parse Cloud Code and start using it.
There’s a ton more Mashape APIs there to expose as Parse libraries. Let me know if you’ve turned your API to a Parse Cloud Module so we can gather them here and promote them to other developers! - email@example.com