From 5d5ec9c7b030b52cb19e14c8503c7bb8ca909f16 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 10 Oct 2022 17:25:52 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=81=D0=BE=D0=BB=D1=8C=20=D1=82=D0=B5=D0=BA=D1=81=D1=82?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BE=D0=BC=D0=BE=D1=89=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/index.js b/server/index.js index e7837f1..20f1702 100644 --- a/server/index.js +++ b/server/index.js @@ -16,15 +16,15 @@ let argv; let branch = ''; const argvStrings = ['host', 'port', 'app-dir', 'lib-dir', 'inpx']; -function showHelp() { +function showHelp(defaultConfig) { console.log(utils.versionText(config)); console.log( `Usage: ${config.name} [options] Options: --help Print ${config.name} command line options - --host= Set web server host, default: 0.0.0.0 - --port= Set web server port, default: 22380 + --host= Set web server host, default: ${defaultConfig.server.host} + --port= Set web server port, default: ${defaultConfig.server.port} --app-dir= Set application working directory, default: /.${config.name} --lib-dir= Set library directory, default: the same as ${config.name} executable's --inpx= Set INPX collection file, default: the one that found in library dir @@ -40,6 +40,8 @@ async function init() { //config const configManager = new (require('./config'))();//singleton await configManager.init(dataDir); + const defaultConfig = configManager.config; + await configManager.load(); config = configManager.config; branch = config.branch; @@ -61,7 +63,7 @@ async function init() { //cli if (argv.help) { - showHelp(); + showHelp(defaultConfig); ayncExit.exit(0); } else { log(utils.versionText(config));