Fix error preventing starting parse-server from CLI with a config file
This commit is contained in:
@@ -42,14 +42,6 @@ if (program.args.length > 0 ) {
|
|||||||
console.log(`Configuation loaded from ${jsonPath}`)
|
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) {
|
options = Object.keys(definitions).reduce(function (options, key) {
|
||||||
if (program[key]) {
|
if (program[key]) {
|
||||||
options[key] = program[key];
|
options[key] = program[key];
|
||||||
@@ -61,6 +53,14 @@ if (!options.serverURL) {
|
|||||||
options.serverURL = `http://localhost:${options.port}${options.mountPath}`;
|
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 app = express();
|
||||||
const api = new ParseServer(options);
|
const api = new ParseServer(options);
|
||||||
app.use(options.mountPath, api);
|
app.use(options.mountPath, api);
|
||||||
|
|||||||
Reference in New Issue
Block a user