From cf47c24274381dc9676bdebaaf65fb2931e42aa0 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 5 Sep 2021 13:47:51 +0800 Subject: [PATCH] rename 'from' to 'webroot' --- server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server.js b/server.js index 880ffe1..0df0a16 100644 --- a/server.js +++ b/server.js @@ -10,13 +10,13 @@ const wo = (global.wo = { ['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 ', 'Path to serve as website'], + ['webroot', '-w, --webroot ', 'Path to serve as website'], ['ssl', '--ssl ', 'SSL options in JSON string.'], ], // 最基础的必须的默认配置,如果用户什么也没有提供 protocol: 'http', host: 'localhost', - from: './www', // local path to serve as webroot + webroot: 'webroot', // local path to serve as webroot // 如果使用虚拟主机 /* vhosts: [ @@ -59,7 +59,7 @@ if (typeof wo.envi.ssl === 'string') { // 所以,如果 vhost匹配了域名,且static找到了文件,就结束了。如果 vhost 匹配了域名,但static找不到文件,就继续往下。 if (!wo.envi.vhosts) { server.use( - express.static(path.join(process.cwd(), wo.envi.from), { + express.static(path.join(process.cwd(), wo.envi.webroot), { index: 'index.html', }) )