Skip to content

Commit

Permalink
accept server url env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Creager committed Feb 25, 2016
1 parent 7e76fda commit c86fab4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"logo": "https://avatars0.githubusercontent.com/u/1294580?v=3&s=200",
"keywords": ["node", "express", "parse"],
"env": {
"PARSER_SERVER_URL": {
"description": "URL to your parse server with http:// or https://",
"required": true
},
"PARSE_MOUNT": {
"description": "Configure Parse API route.",
"value": "/parse"
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
var express = require('express');
var ParseServer = require('parse-server').ParseServer;

var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;

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

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

0 comments on commit c86fab4

Please sign in to comment.