*UPDATE 2012-11-01 – Parse has released an official Windows tool for Cloud Code. Check it here*
They have recently rolled out a feature called Cloud Code which lets you build code on the Parse cloud and expose them as functions (APIs) that can be called in your client-side Parse code. This allows for the same benefits that we enjoy in a traditional API model.
Below are the steps on how to get your Parse Cloud Code tool running on Windows – we’re using Cygwin. (The original steps can be found in the Parse Cloud Code Guide page).
- Install Cygwin from this page. Just click the setup.exe link on that page and go through normal installation process (keep clicking Next unless you know what you’re doing) until you get to the “Select Packages” window that allows you to pick the packages for your Cygwin installation (see image below to see what this looks like). Cygwin allows you to run Unix-based tools in Windows.
2. We’re now going to install the Python and curl packages. We need Python because the Parse Cloud code tool was coded in Python. We need curl because it is called in the installer script that we will run later.
Start by searching “Python” in the search field and navigating to the Python hierarchy below when the results come up. (Note: Be careful not to hit “Enter” after typing in Python. It will search as you type. You might accidentally start downloading if you hit Enter). Click on the “Default” word beside it until it says “Install”. Mine looks like this (see image below). (Frankly I’m not sure which specific Python to install so I installed the whole branch. It worked for me, but it would be great if anyone can correct me here).
After Python, do the same thing with curl. I clicked to “Install” on All (again because I’m not sure 😛 – appreciate if anyone can correct me here)
Once these packages are chosen, click “Next” to start the download.
If everything’s successful, you should have an application called “Cygwin Terminal” If you run it, it would look similar to the image below. This gives us a Unix environment where we can type in the commands in the Cloud Code guide. Type “pwd” to show you your current directory.
3. Download the installer script (installer.sh) by clicking here. This installer script downloads the actual Parse Cloud Code tool, and puts it in the proper folder so we can call it from anywhere inside Cygwin. Note that this script cannot be executed inside a DOS command prompt – it should be inside Cygwin, and in a folder accessible by the Cygwin terminal.
In my case, the “/home/Chris” folder from the image above maps to “C:\Users\Chris\Documents\cygwin\home\Chris” because I chose to install Cygwin inside the My Documents folder. Normally, you’d install it in your root drive (e.g. C:\\). In my case, I placed the installer.sh file in a “parse” folder I created inside “/home/Chris”. See image below to see what this looks like.
4. Before we run the installer.sh in Cygwin, we need to make a minor change. Open up the installer.sh file with your favorite text editor (I use TextPad). Replace “https” with “http”, without the ‘s’. Save the file.
We’re doing this because you’ll run into a certificate error when you try to run the script. I can’t be bothered fixing that part, so I’d rather be just a bit unsecure, with http 🙂
5. Last step! Go back to the Cygwin terminal and navigate to the folder where you placed installer.sh. Once you’re there type “bash installer.sh”. This will start a quick installation. See mine below.
Type “parse” to check if the installation was successful. If you get the parse parameters info, you’re good to go! You can go back to the Parse Cloud Code guide and start from “Setting Up Cloud Code“