3
3
4
4
var express = require ( 'express' ) ;
5
5
var ParseServer = require ( 'parse-server' ) . ParseServer ;
6
- var http = require ( 'http' ) ;
7
6
8
7
if ( ! process . env . DATABASE_URI ) {
9
8
console . log ( 'DATABASE_URI not specified, falling back to localhost.' ) ;
@@ -12,8 +11,8 @@ if (!process.env.DATABASE_URI) {
12
11
var api = new ParseServer ( {
13
12
databaseURI : process . env . DATABASE_URI || 'mongodb://localhost:27017/dev' ,
14
13
cloud : process . env . CLOUD_CODE_MAIN || __dirname + '/cloud/main.js' ,
15
- appId : 'myAppId' ,
16
- masterKey : 'myMasterKey'
14
+ appId : process . env . APP_ID || 'myAppId' ,
15
+ masterKey : process . env . MASTER_KEY || 'myMasterKey'
17
16
} ) ;
18
17
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
19
18
// 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) {
31
30
} ) ;
32
31
33
32
var port = process . env . PORT || 1337 ;
34
- var httpServer = http . createServer ( app ) ;
35
- httpServer . listen ( port , function ( ) {
36
- console . log ( 'parse-server-example running on port ' + port + '.' ) ;
33
+ app . listen ( port , function ( ) {
34
+ console . log ( 'parse-server-example running on port ' + port + '.' ) ;
37
35
} ) ;
0 commit comments