This commit is contained in:
陆柯 2021-10-17 11:36:37 +08:00
parent 7e796f4527
commit 57b68eb036

View File

@ -59,9 +59,7 @@ if (typeof wo.envi.ssl === 'string') {
// 所以,如果 vhost匹配了域名且static找到了文件就结束了。如果 vhost 匹配了域名但static找不到文件就继续往下。 // 所以,如果 vhost匹配了域名且static找到了文件就结束了。如果 vhost 匹配了域名但static找不到文件就继续往下。
if (!wo.envi.vhosts) { if (!wo.envi.vhosts) {
server.use( server.use(
express.static(path.join(process.cwd(), wo.envi.webroot), { express.static(path.join(__dirname, wo.envi.webroot).replace('\\', '/'), { index: 'index.html' }) // 可以指定到 node应用之外的目录上。windows里要把 \ 换成 /。
index: 'index.html',
})
) )
// server.use(require('serve-favicon')(path.join(process.cwd(), 'public', 'favicon.ico'))) // uncomment after placing your favicon in /public // server.use(require('serve-favicon')(path.join(process.cwd(), 'public', 'favicon.ico'))) // uncomment after placing your favicon in /public
} else { } else {
@ -71,9 +69,7 @@ if (typeof wo.envi.ssl === 'string') {
server.use( server.use(
vhost( vhost(
domain, domain,
express.static(path.join(process.cwd(), h.webroot), { express.static(path.join(__dirname, h.webroot).replace('\\', '/'), { index: h.webindex }) // 可以指定到 node应用之外的目录上。windows里要把 \ 换成 /。
index: h.webindex,
})
) )
) )
} }