File tree Expand file tree Collapse file tree 3 files changed +37
-8
lines changed Expand file tree Collapse file tree 3 files changed +37
-8
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,15 @@ Read the full server guide here: https://parse.com/docs/server/guide
1818
1919### Getting Started With Heroku + Mongolab Development
2020
21+ #### With the Heroku Button
22+
23+ [ ![ Deploy] ( https://www.herokucdn.com/deploy/button.png )] ( https://heroku.com/deploy )
24+
25+ #### Without It
26+
2127* Clone the repo and change directory to it
22- * Use the Heroku Toolbelt to log in and prepare the app
23- * Use the MongoLab addon: ` heroku addons:create mongolab:sandbox `
24- * Use ` heroku config ` and note the URI provided by MongoLab under the var MONGOLAB_URI
25- * Copy this URI and set it as a new config variable: ` heroku config:set DATABASE_URI=mongodb://... `
28+ * Log in with the [ Heroku Toolbelt] ( https://toolbelt.heroku.com/ ) and create an app: ` heroku create `
29+ * Use the [ MongoLab addon] ( https://elements.heroku.com/addons/mongolab ) : ` heroku addons:create mongolab:sandbox `
2630* 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 `
2731* Deploy it with: ` git push heroku master `
2832
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " Parse Server Example" ,
3+ "description" : " An example Parse API server using the parse-server module" ,
4+ "repository" : " https://github.com/ParsePlatform/parse-server-example" ,
5+ "logo" : " https://avatars0.githubusercontent.com/u/1294580?v=3&s=200" ,
6+ "keywords" : [" node" , " express" , " parse" ],
7+ "env" : {
8+ "PARSE_MOUNT" : {
9+ "description" : " Configure Parse API route." ,
10+ "value" : " /parse"
11+ },
12+ "APP_ID" : {
13+ "description" : " A unique identifier for your app." ,
14+ "value" : " myAppId"
15+ },
16+ "MASTER_KEY" : {
17+ "description" : " A key that overrides all permissions. Keep this secret." ,
18+ "value" : " myMasterKey"
19+ }
20+ },
21+ "image" : " heroku/nodejs" ,
22+ "addons" : [" mongolab" ]
23+ }
Original file line number Diff line number Diff line change @@ -5,15 +5,17 @@ var express = require('express');
55var ParseServer = require ( 'parse-server' ) . ParseServer ;
66var http = require ( 'http' ) ;
77
8- if ( ! process . env . DATABASE_URI ) {
8+ var databaseUri = process . env . DATABASE_URI || process . env . MONGOLAB_URI
9+
10+ if ( ! databaseUri ) {
911 console . log ( 'DATABASE_URI not specified, falling back to localhost.' ) ;
1012}
1113
1214var api = new ParseServer ( {
13- databaseURI : process . env . DATABASE_URI || 'mongodb://localhost:27017/dev' ,
15+ databaseURI : databaseUri || 'mongodb://localhost:27017/dev' ,
1416 cloud : process . env . CLOUD_CODE_MAIN || __dirname + '/cloud/main.js' ,
15- appId : 'myAppId' ,
16- masterKey : 'myMasterKey'
17+ appId : process . env . APP_ID || 'myAppId' ,
18+ masterKey : process . env . MASTER_KEY || 'myMasterKey'
1719} ) ;
1820// Client-keys like the javascript key or the .NET key are not necessary with parse-server
1921// If you wish you require them, you can set them as options in the initialization above:
You can’t perform that action at this time.
0 commit comments