Skip to content

Commit c86fab4

Browse files
author
Matt Creager
committed
accept server url env var
Resolves yongjhih#74
1 parent 7e76fda commit c86fab4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
"logo": "https://avatars0.githubusercontent.com/u/1294580?v=3&s=200",
66
"keywords": ["node", "express", "parse"],
77
"env": {
8+
"PARSER_SERVER_URL": {
9+
"description": "URL to your parse server with http:// or https://",
10+
"required": true
11+
},
812
"PARSE_MOUNT": {
913
"description": "Configure Parse API route.",
1014
"value": "/parse"

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
var express = require('express');
55
var ParseServer = require('parse-server').ParseServer;
66

7-
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI
7+
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;
88

99
if (!databaseUri) {
1010
console.log('DATABASE_URI not specified, falling back to localhost.');
1111
}
1212

1313
var api = new ParseServer({
14+
serverURL: process.env.PARSE_SERVER_URL,
1415
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
1516
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
1617
appId: process.env.APP_ID || 'myAppId',

0 commit comments

Comments
 (0)