Skip to content

Commit

Permalink
Bind port for serverURL
Browse files Browse the repository at this point in the history
  • Loading branch information
yongjhih committed Apr 12, 2016
1 parent db86ba0 commit a7a59b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ if ((gcmId && gcmKey) || (productionPfx && productionBundleId) || (devBundleId &
};
}

var port = process.env.PORT || 1337;
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
var serverURL = process.env.SERVER_URL || 'http://localhost:1337' + mountPath; // Don't forget to change to https if needed
var serverURL = process.env.SERVER_URL || 'http://localhost:' + port + mountPath; // Don't forget to change to https if needed

var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
Expand Down Expand Up @@ -104,7 +105,6 @@ app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site.');
});

var port = process.env.PORT || 1337;
app.listen(port, function() {
console.log('parse-server-example running on ' + serverURL + ' (:' + port + mountPath + ')');
});

0 comments on commit a7a59b0

Please sign in to comment.