Browse Source

support additional config via env vars and button

Matt Creager 9 years ago
parent
commit
b34e7f5832
2 changed files with 10 additions and 2 deletions
  1. 8 0
      app.json
  2. 2 2
      index.js

+ 8 - 0
app.json

@@ -8,6 +8,14 @@
     "PARSE_MOUNT": {
       "description": "Configure Parse API route.",
       "value": "/parse"
+    },
+    "APP_ID": {
+      "description": "A unique identifier for your app.",
+      "value": "myAppId"
+    },
+    "MASTER_KEY": {
+      "description": "A key that overrides all permissions. Keep this secret.",
+      "value": "myMasterKey"
     }
   },
   "image": "heroku/nodejs",

+ 2 - 2
index.js

@@ -14,8 +14,8 @@ if (!databaseUri) {
 var api = new ParseServer({
   databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
   cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
-  appId: 'myAppId',
-  masterKey: 'myMasterKey'
+  appId: process.env.APP_ID || 'myAppId',
+  masterKey: process.env.MASTER_KEY || 'myMasterKey'
 });
 // Client-keys like the javascript key or the .NET key are not necessary with parse-server
 // If you wish you require them, you can set them as options in the initialization above: