Skip to content

Commit 83d73b8

Browse files
author
Matt Creager
committed
accept Mongo connection URI via the MONGOLAB_URI config var
1 parent b37f965 commit 83d73b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ var express = require('express');
55
var ParseServer = require('parse-server').ParseServer;
66
var http = require('http');
77

8-
if (!process.env.DATABASE_URI) {
8+
var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI
9+
10+
if (!databaseUri) {
911
console.log('DATABASE_URI not specified, falling back to localhost.');
1012
}
1113

1214
var api = new ParseServer({
13-
databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev',
15+
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
1416
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
1517
appId: 'myAppId',
1618
masterKey: 'myMasterKey'

0 commit comments

Comments
 (0)