Fix error preventing starting parse-server from CLI with a config file

This commit is contained in:
Florent Vilmart
2016-03-01 22:33:58 -05:00
parent 92e51ab4d3
commit a0150a743f

View File

@@ -42,14 +42,6 @@ if (program.args.length > 0 ) {
console.log(`Configuation loaded from ${jsonPath}`)
}
if (!program.appId || !program.masterKey || !program.serverURL) {
program.outputHelp();
console.error("");
console.error(colors.red("ERROR: appId, masterKey and serverURL are required"));
console.error("");
process.exit(1);
}
options = Object.keys(definitions).reduce(function (options, key) {
if (program[key]) {
options[key] = program[key];
@@ -61,6 +53,14 @@ if (!options.serverURL) {
options.serverURL = `http://localhost:${options.port}${options.mountPath}`;
}
if (!options.appId || !options.masterKey || !options.serverURL) {
program.outputHelp();
console.error("");
console.error(colors.red("ERROR: appId, masterKey and serverURL are required"));
console.error("");
process.exit(1);
}
const app = express();
const api = new ParseServer(options);
app.use(options.mountPath, api);