Site icon Web Niraj

Parse.com: Setting up the Open Source Parse API Server

Following Parse’s announcement of the service winding down and the subsequent release of the Parse API Server, I’ve taken the time to setup my own instance of the open-source software to help migrate from Parse.com before it shuts down in January 2017.

Prerequisites

If you’re setting up Parse Server on your server or local machine, you need to make sure the following packages are installed:

Setting up Node Modules

Decide on where you want your Parse API server to live on your server. For the purpose of this guide, I’m using the location /var/www/parse/. Start by installing the following Node packages using npm:

See the gist on github.

Note: If you have trouble installing the above packages, you may need to make sure you have the required dependencies installed. For example, installing the libkrb5-dev library, using the following command line on Ubuntu:

sudo apt-get install libkrb5-dev

Setting up Parse Server

Once the packages are installed, we create a Express App to mount the Parse API at a specified path. I created the file app.js within the /var/www/parse/ folder (this folder should now contain a folder called node_modules) and copied and pasted in the below code:

See the gist on github.

You will need to change the databaseURI setting (line 9) to point to your MongoDB instance.

Remember to change the appId and masterKey settings (line 10-11) in the above file to reflect your application. If you want to use a different path or port, you can change those too in the above code. By default, the API will be served on the /parse URL (e.g. https://localhost/parse), using port 1377.

Running the Parse Server

Once everything has been setup, you can start the Parse API server by running node app.js from the installed folder. If everything works correctly, you’ll see something like:

Then, if you visit your server URL, e.g. https://localhost:1377/parse, you should see the Parse API server running:

I know what you’re thinking… It may look like an error message, but it means the Parse API server is working. Now you can confirm it by following the verification steps below.

Verification

You can also verify that the Parse API Server is running correctly by using some cURL commands. For example, you can issue the following two commands to save and retrieve data:

See the gist on github.

Amazom AMI

I have also created a Amazon Machine Image (AMI) on AWS with everything already setup and ready to go. You can follow this AWS Guide to add my AMI.

The AMI Name is: Parse-Server (located in Europe Ireland)

Bugs and Issues

The Parse API Server was only recently released and may not work exactly as the Parse.com service works. If you encounter issues with using the server, you can post your issues and bugs on the Issue Tracker.

For anything else, feel free to post a comment below.

Exit mobile version