Skip to content

Our own parse server using Express and the parse-server module.

Notifications You must be signed in to change notification settings

truffls/parse-server

 
 

Repository files navigation

parse-server

Truffls 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

Upgrading the mongo db scheme

When upgrading from the original mongo db dump to the latest parse server version, you have to delete some indexes, otherwise you will face some errors on startup. Connect to the correct mongo db and there run:

db.getCollection("_Role").dropIndex("name_1")
db.getCollection("_Audience").dropIndex("name_1")
db.getCollection("_User").dropIndex("username_1")
db.getCollection("_User").dropIndex("email_1")

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
  • 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 AWS Elastic Beanstalk

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>
  • Deploy:
eb deploy <environment_name>

Using it

Before using it, you can access a test page to verify if the basic setup is working fine http://localhost:1337/. 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}' \
  http://localhost:1337/parse/classes/GameScore
  
curl -X POST \
  -H "X-Parse-Application-Id: myAppId" \
  -H "Content-Type: application/json" \
  -d '{}' \
  http://localhost:1337/parse/functions/hello

About

Our own parse server using Express and the parse-server module.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.8%
  • Dockerfile 4.2%