|
@@ -3,7 +3,6 @@
|
|
|
|
|
|
var express = require('express');
|
|
var express = require('express');
|
|
var ParseServer = require('parse-server').ParseServer;
|
|
var ParseServer = require('parse-server').ParseServer;
|
|
-var http = require('http');
|
|
|
|
|
|
|
|
if (!process.env.DATABASE_URI) {
|
|
if (!process.env.DATABASE_URI) {
|
|
console.log('DATABASE_URI not specified, falling back to localhost.');
|
|
console.log('DATABASE_URI not specified, falling back to localhost.');
|
|
@@ -12,8 +11,8 @@ if (!process.env.DATABASE_URI) {
|
|
var api = new ParseServer({
|
|
var api = new ParseServer({
|
|
databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev',
|
|
databaseURI: process.env.DATABASE_URI || 'mongodb://localhost:27017/dev',
|
|
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
|
|
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
|
|
- appId: 'myAppId',
|
|
|
|
- masterKey: 'myMasterKey'
|
|
|
|
|
|
+ appId: process.env.APP_ID || 'myAppId',
|
|
|
|
+ masterKey: process.env.MASTER_KEY || 'myMasterKey'
|
|
});
|
|
});
|
|
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
|
|
// 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:
|
|
// If you wish you require them, you can set them as options in the initialization above:
|
|
@@ -31,7 +30,6 @@ app.get('/', function(req, res) {
|
|
});
|
|
});
|
|
|
|
|
|
var port = process.env.PORT || 1337;
|
|
var port = process.env.PORT || 1337;
|
|
-var httpServer = http.createServer(app);
|
|
|
|
-httpServer.listen(port, function() {
|
|
|
|
- console.log('parse-server-example running on port ' + port + '.');
|
|
|
|
|
|
+app.listen(port, function() {
|
|
|
|
+ console.log('parse-server-example running on port ' + port + '.');
|
|
});
|
|
});
|