From 83581c72c85fc7c67c7e440a3da7ba383136b9c2 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Tue, 26 Jan 2021 17:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=20from=20=E7=AD=89=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server.js b/server.js index 4ad34ca..5febbca 100644 --- a/server.js +++ b/server.js @@ -3,6 +3,15 @@ const path = require('path') const Config = Object.assign( { + commanderOptions: [ + // 命令行里可以接受的参数。将传给 config.js 里的 commander。每个参数的定义格式是 [参数名,参数键,描述],后两者用于传给commander,取值后覆盖掉Config里的同名变量。 + ['protocol', '-P, --protocol ', 'Web Server protocol: http|https|httpall.'], + ['host', '-h, --host ', 'Host IP or domain name, default to localhost.'], + + ['port', '-p, --port ', 'HTTP port number.'], + ['from', '-f, --from ', 'Seed list such as \'["http://ip_or_dn:port"]\' or "noseed" to disable seeding.'], + ['env', '-e, --env ', 'Runtime environment: production | development.'], + ], // 最基础的必须的默认配置,如果用户什么也没有提供 protocol: 'http', host: 'localhost',