Example server using Express and the parse-server module.
Branch: master
Clone or download
Pull request Compare This branch is 27 commits ahead, 9 commits behind parse-community:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This a repository made for deployment of parse-server to OpenShift PaaS Service

With the OpenShift Deploy Button

![Deploy to OpenShift](http://launch-shifter.rhcloud.com/launch/Deploy to.svg)

  • If you use rhc, run the following command to set up you Parse APP_ID and MASTER_KEY rhc env set APP_ID=myAppId MASTER_KEY=myMasterKey -a myAppName replace myAppId and myMasterKey with your actual app id and master key
  • If you don’t – than clone your OpenShift application repository with git using “Source Code” link from the application details in web console, and modify “appId” and “masterKey” values in index.js file
var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || 'myMasterKey' //Add your master key here. Keep it secret!

replace myAppId and myMasterKey with your actual app id and master key, commit and push you changes to remote.

With OpenShift Client Tools(RHC)

rhc app create parseaio http://cartreflect-claytondev.rhcloud.com/github/icflorescu/openshift-cartridge-nodejs http://cartreflect-claytondev.rhcloud.com/github/icflorescu/openshift-cartridge-mongodb --from-code https://github.com/antt001/parse-server-example --env

This is a fork of parse-server-example

Example project using the parse-server module on Express.

Read the full Parse Server guide here: https://github.com/ParsePlatform/parse-server/wiki/Parse-Server-Guide

For Local Development

  • Make sure you have at least Node 4.3. node --version
  • Clone this repo and change directory to it.
  • npm install
  • Install mongo locally using http://docs.mongodb.org/master/tutorial/install-mongodb-on-os-x/
  • Run mongo to connect to your database, just to make sure it's working. Once you see a mongo prompt, exit with Control-D
  • Run the server with: npm start
  • By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run export PARSE_MOUNT=/1 before launching the server.
  • You now have a database named "dev" that contains your Parse data
  • Install ngrok and you can test with devices

Getting Started With Heroku + mLab Development

With the Heroku Button


Without It

  • Clone the repo and change directory to it
  • Log in with the Heroku Toolbelt and create an app: heroku create
  • Use the mLab addon: heroku addons:create mongolab:sandbox --app YourAppName
  • By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run heroku config:set PARSE_MOUNT=/1
  • Deploy it with: git push heroku master

Getting Started With AWS Elastic Beanstalk

With the Deploy to AWS Button

Without It

  • Clone the repo and change directory to it
  • Log in with the AWS Elastic Beanstalk CLI, select a region, and create an app: eb init
  • Create an environment and pass in MongoDB URI, App ID, and Master Key: eb create --envvars DATABASE_URI=<replace with URI>,APP_ID=<replace with Parse app ID>,MASTER_KEY=<replace with Parse master key>

Getting Started With Microsoft Azure App Service

With the Deploy to Azure Button

Deploy to Azure

Without It

A detailed tutorial is available here: Azure welcomes Parse developers

Getting Started With Google App Engine

  1. Clone the repo and change directory to it
  2. Create a project in the Google Cloud Platform Console.
  3. Enable billing for your project.
  4. Install the Google Cloud SDK.
  5. Setup a MongoDB server. You have a few options:
  6. Create a Google Compute Engine virtual machine with MongoDB pre-installed.
  7. Use MongoLab to create a free MongoDB deployment on Google Cloud Platform.
  8. Modify app.yaml to update your environment variables.
  9. Delete Dockerfile
  10. Deploy it with gcloud preview app deploy

A detailed tutorial is available here: Running Parse server on Google App Engine

Getting Started With Scalingo

With the Scalingo button

Deploy to Scalingo

Without it

  • Clone the repo and change directory to it
  • Log in with the Scalingo CLI and create an app: scalingo create my-parse
  • Use the Scalingo MongoDB addon: scalingo addons-add scalingo-mongodb free
  • Setup MongoDB connection string: scalingo env-set DATABASE_URI='$SCALINGO_MONGO_URL'
  • By default it will use a path of /parse for the API routes. To change this, or use older client SDKs, run scalingo env-set PARSE_MOUNT=/1
  • Deploy it with: git push scalingo master

Getting Started With OpenShift Online (Next Gen)

  1. Register for a free OpenShift Online (Next Gen) account
  2. Create a project in the OpenShift Online Console.
  3. Install the OpenShift CLI.
  4. Add the Parse Server template to your project: oc create -f https://raw.githubusercontent.com/ParsePlatform/parse-server-example/master/openshift.json
  5. Deploy Parse Server from the web console
  6. Open your project in the OpenShift Online Console:
  7. Click Add to Project from the top navigation
  8. Scroll down and select NodeJS > Parse Server
  9. (Optionally) Update the Parse Server settings (parameters)
  10. Click Create

A detailed tutorial is available here: Running Parse Server on OpenShift Online (Next Gen)

Using it

Before using it, you can access a test page to verify if the basic setup is working fine http://localhost:1337/test. Then you can use the REST API, the JavaScript SDK, and any of our open-source SDKs:

Example request to a server running locally:

curl -X POST \
  -H "X-Parse-Application-Id: myAppId" \
  -H "Content-Type: application/json" \
  -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
curl -X POST \
  -H "X-Parse-Application-Id: myAppId" \
  -H "Content-Type: application/json" \
  -d '{}' \

Example using it via JavaScript:

Parse.serverURL = 'https://whatever.herokuapp.com';

var obj = new Parse.Object('GameScore');
obj.save().then(function(obj) {
  var query = new Parse.Query('GameScore');
  query.get(obj.id).then(function(objAgain) {
  }, function(err) {console.log(err); });
}, function(err) { console.log(err); });

Example using it on Android:

//in your application class

Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
  .server("http://myServerUrl/parse/")   // '/' important after 'parse'

ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");

Example using it on iOS (Swift):

//in your AppDelegate

Parse.initializeWithConfiguration(ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) -> Void in
  configuration.server = "https://<# Your Server URL #>/parse/" // '/' important after 'parse'
  configuration.applicationId = "<# Your APP_ID #>"

You can change the server URL in all of the open-source SDKs, but we're releasing new builds which provide initialization time configuration of this property.