File tree 3 files changed +37
-8
lines changed
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
18
18
19
19
### Getting Started With Heroku + Mongolab Development
20
20
21
+ #### With the Heroku Button
22
+
23
+ [ ![ Deploy] ( https://www.herokucdn.com/deploy/button.png )] ( https://heroku.com/deploy )
24
+
25
+ #### Without It
26
+
21
27
* 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 `
26
30
* 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 `
27
31
* Deploy it with: ` git push heroku master `
28
32
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');
5
5
var ParseServer = require ( 'parse-server' ) . ParseServer ;
6
6
var http = require ( 'http' ) ;
7
7
8
- if ( ! process . env . DATABASE_URI ) {
8
+ var databaseUri = process . env . DATABASE_URI || process . env . MONGOLAB_URI
9
+
10
+ if ( ! databaseUri ) {
9
11
console . log ( 'DATABASE_URI not specified, falling back to localhost.' ) ;
10
12
}
11
13
12
14
var api = new ParseServer ( {
13
- databaseURI : process . env . DATABASE_URI || 'mongodb://localhost:27017/dev' ,
15
+ databaseURI : databaseUri || 'mongodb://localhost:27017/dev' ,
14
16
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'
17
19
} ) ;
18
20
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
19
21
// 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