supports keys marked as false
This commit is contained in:
@@ -9,7 +9,7 @@ program.loadDefinitions(definitions);
|
|||||||
|
|
||||||
program
|
program
|
||||||
.usage('[options] <path/to/configuration.json>');
|
.usage('[options] <path/to/configuration.json>');
|
||||||
|
|
||||||
program.on('--help', function(){
|
program.on('--help', function(){
|
||||||
console.log(' Get Started guide:');
|
console.log(' Get Started guide:');
|
||||||
console.log('');
|
console.log('');
|
||||||
@@ -31,7 +31,7 @@ program.on('--help', function(){
|
|||||||
console.log(' $ parse-server -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL');
|
console.log(' $ parse-server -- --appId APP_ID --masterKey MASTER_KEY --serverURL serverURL');
|
||||||
console.log('');
|
console.log('');
|
||||||
});
|
});
|
||||||
|
|
||||||
program.parse(process.argv, process.env);
|
program.parse(process.argv, process.env);
|
||||||
|
|
||||||
let options = {};
|
let options = {};
|
||||||
@@ -48,10 +48,10 @@ if (program.args.length > 0 ) {
|
|||||||
options = jsonConfig;
|
options = jsonConfig;
|
||||||
}
|
}
|
||||||
console.log(`Configuation loaded from ${jsonPath}`)
|
console.log(`Configuation loaded from ${jsonPath}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
options = Object.keys(definitions).reduce(function (options, key) {
|
options = Object.keys(definitions).reduce(function (options, key) {
|
||||||
if (program[key]) {
|
if (typeof program[key] !== 'undefined') {
|
||||||
options[key] = program[key];
|
options[key] = program[key];
|
||||||
}
|
}
|
||||||
return options;
|
return options;
|
||||||
@@ -74,7 +74,7 @@ const api = new ParseServer(options);
|
|||||||
app.use(options.mountPath, api);
|
app.use(options.mountPath, api);
|
||||||
|
|
||||||
var server = app.listen(options.port, function() {
|
var server = app.listen(options.port, function() {
|
||||||
|
|
||||||
for (let key in options) {
|
for (let key in options) {
|
||||||
let value = options[key];
|
let value = options[key];
|
||||||
if (key == "masterKey") {
|
if (key == "masterKey") {
|
||||||
|
|||||||
Reference in New Issue
Block a user