From 2d1dbe8eee016146c617cfa2b9c70a87889ad998 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Mon, 18 Oct 2021 21:55:48 +0800 Subject: [PATCH] u --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 7124eb1..2e28017 100644 --- a/server.js +++ b/server.js @@ -17,6 +17,7 @@ const wo = (global.wo = { protocol: 'http', host: 'localhost', webroot: 'webroot', // local path to serve as webroot + webindex: 'index.html', // 如果使用虚拟主机 /* vhosts: [ @@ -59,7 +60,7 @@ if (typeof wo.envi.ssl === 'string') { // 所以,如果 vhost匹配了域名,且static找到了文件,就结束了。如果 vhost 匹配了域名,但static找不到文件,就继续往下。 if (!wo.envi.vhosts) { server.use( - express.static(path.join(__dirname, wo.envi.webroot).replace('\\', '/'), { index: 'index.html' }) // 可以指定到 node应用之外的目录上。windows里要把 \ 换成 /。 + express.static(path.join(__dirname, wo.envi.webroot).replace('\\', '/'), { index: wo.envi.webindex }) // 可以指定到 node应用之外的目录上。windows里要把 \ 换成 /。 ) // server.use(require('serve-favicon')(path.join(process.cwd(), 'public', 'favicon.ico'))) // uncomment after placing your favicon in /public } else {