parse-community/parse-server-example

Name: parse-server-example

Owner: Parse

Description: Example server using Express and the parse-server module.

Created: 2016-01-28 20:40:47.0

Updated: 2018-01-15 21:30:50.0

Pushed: 2018-01-10 20:42:12.0

Homepage: http://parseplatform.org

Size: 80

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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
Getting Started With Heroku + mLab Development
With the Heroku Button

Deploy

Without It
Getting Started With AWS Elastic Beanstalk
With the Deploy to AWS Button

Without It
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 mLab to create a free MongoDB deployment on Google Cloud Platform (only US-central).
  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
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:

 -X POST \
 "X-Parse-Application-Id: myAppId" \
 "Content-Type: application/json" \
 '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
tp://localhost:1337/parse/classes/GameScore

 -X POST \
 "X-Parse-Application-Id: myAppId" \
 "Content-Type: application/json" \
 '{}' \
tp://localhost:1337/parse/functions/hello

Example using it via JavaScript:

e.initialize('myAppId','unused');
e.serverURL = 'https://whatever.herokuapp.com';

obj = new Parse.Object('GameScore');
set('score',1337);
save().then(function(obj) {
nsole.log(obj.toJSON());
r query = new Parse.Query('GameScore');
ery.get(obj.id).then(function(objAgain) {
console.log(objAgain.toJSON());
 function(err) {console.log(err); });
unction(err) { console.log(err); });

Example using it on Android:

 your application class

e.initialize(new Parse.Configuration.Builder(getApplicationContext())
pplicationId("myAppId")
erver("http://myServerUrl/parse/")   // '/' important after 'parse'
uild());

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

Example using it on iOS (Swift):

 your AppDelegate

e.initializeWithConfiguration(ParseClientConfiguration(block: { (configuration: ParseMutableClientConfiguration) -> Void in
nfiguration.server = "https://<# Your Server URL #>/parse/" // '/' important after 'parse'
nfiguration.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.

As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.