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
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")
- 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
- 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>
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