File tree 2 files changed +12
-8
lines changed 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,6 @@ export default {
9
9
help : "Your Parse Master Key" ,
10
10
required : true
11
11
} ,
12
- "serverURL" : {
13
- env : "PARSE_SERVER_URL" ,
14
- help : "URL to your parse server with http:// or https://." ,
15
- required : true
16
- } ,
17
12
"port" : {
18
13
port : "PORT" ,
19
14
help : "The port to run the ParseServer. defaults to 1337." ,
@@ -30,6 +25,10 @@ export default {
30
25
env : "PARSE_SERVER_DATABASE_URI" ,
31
26
help : "The full URI to your mongodb database"
32
27
} ,
28
+ "serverURL" : {
29
+ env : "PARSE_SERVER_URL" ,
30
+ help : "URL to your parse server with http:// or https://." ,
31
+ } ,
33
32
"clientKey" : {
34
33
env : "PARSE_SERVER_CLIENT_KEY" ,
35
34
help : "Key for iOS, MacOS, tvOS clients"
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ program.on('--help', function(){
34
34
35
35
program . parse ( process . argv , process . env ) ;
36
36
37
+ let options ;
37
38
if ( program . args . length > 0 ) {
38
39
let jsonPath = program . args [ 0 ] ;
39
40
jsonPath = path . resolve ( jsonPath ) ;
@@ -49,12 +50,16 @@ if (!program.appId || !program.masterKey || !program.serverURL) {
49
50
process . exit ( 1 ) ;
50
51
}
51
52
52
- let options = Object . keys ( definitions ) . reduce ( function ( options , key ) {
53
+ options = Object . keys ( definitions ) . reduce ( function ( options , key ) {
53
54
if ( program [ key ] ) {
54
55
options [ key ] = program [ key ] ;
55
56
}
56
57
return options ;
57
- } , { } ) ;
58
+ } , options ) ;
59
+
60
+ if ( ! options . serverURL ) {
61
+ options . serverURL = `http://localhost:${ options . port } ${ options . mountPath } ` ;
62
+ }
58
63
59
64
const app = express ( ) ;
60
65
const api = new ParseServer ( options ) ;
@@ -70,5 +75,5 @@ app.listen(options.port, function() {
70
75
console . log ( `${ key } : ${ value } ` ) ;
71
76
}
72
77
console . log ( '' ) ;
73
- console . log ( 'parse-server running on http://localhost:' + options . port + options . mountPath ) ;
78
+ console . log ( 'parse-server running on ' + options . serverURL ) ;
74
79
} ) ;
You can’t perform that action at this time.
0 commit comments