Browse Source

Add server url

Roger Hu 9 years ago
parent
commit
b9550a1121
4 changed files with 17 additions and 3 deletions
  1. 1 1
      .ebextensions/app.config
  2. 4 0
      app.json
  3. 10 1
      azuredeploy.json
  4. 2 1
      index.js

+ 1 - 1
.ebextensions/app.config

@@ -5,6 +5,6 @@ option_settings:
     MASTER_KEY: "ReplaceWithMasterKey"
     DATABASE_URI: "ReplaceWithDatabaseURI"
     NODE_ENV: "production"
-
+    SERVER_URL: "http://myappname.elasticbeanstalk.com/parse"
   aws:elasticbeanstalk:container:nodejs:
     NodeCommand: "npm start"

+ 4 - 0
app.json

@@ -16,6 +16,10 @@
     "MASTER_KEY": {
       "description": "A key that overrides all permissions. Keep this secret.",
       "value": "myMasterKey"
+    },
+    "SERVER_URL": {
+      "description": "URL of your Heroku instance",
+      "value": "http://myapp.herokuapp.com/parse"
     }
   },
   "image": "heroku/nodejs",

+ 10 - 1
azuredeploy.json

@@ -44,6 +44,11 @@
       "minLength": 1,
       "defaultValue": "myMasterKey"
     },
+    "parseServerUrl": {
+      "type": "string",
+      "minLength": 1,
+      "defaultValue": "http://yourappname.azure.com/parse"
+    },
     "repoURL": {
       "type": "string",
       "defaultValue": "https://github.com/parseplatform/parse-server-example.git",
@@ -110,6 +115,10 @@
             "value": "[parameters('parseMasterKey')]"
             },
             {
+            "name": "SERVER_URL",
+            "value": "[parameters('parseServerUrl')]"
+            },
+            {
                 "name": "WEBSITE_NODE_DEFAULT_VERSION",
                 "value": "4.2.3"
             }
@@ -132,4 +141,4 @@
       ]
     }
   ]
-}
+}

+ 2 - 1
index.js

@@ -14,7 +14,8 @@ var api = new ParseServer({
   databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
   cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
   appId: process.env.APP_ID || 'myAppId',
-  masterKey: process.env.MASTER_KEY || '' //Add your master key here. Keep it secret!
+  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
+  serverUrl: process.env.SERVER_URL || 'http://localhost:1337'  // Don't forget to change to https if needed
 });
 // 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: