rename 'from' to 'webroot'
This commit is contained in:
parent
90202815d5
commit
cf47c24274
@ -10,13 +10,13 @@ const wo = (global.wo = {
|
||||
['protocol', '-P, --protocol <string>', 'Web Server protocol: http|https|httpall.'],
|
||||
['host', '-H, --host <string>', 'Host IP or domain name, default to localhost.'],
|
||||
['port', '-p, --port <number>', 'HTTP port number.'],
|
||||
['from', '-f, --from <string>', 'Path to serve as website'],
|
||||
['webroot', '-w, --webroot <string>', 'Path to serve as website'],
|
||||
['ssl', '--ssl <string>', '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',
|
||||
})
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user