优化开发提示

pull/1/head
yutent 2023-05-16 15:09:13 +08:00
parent 1265d0e94f
commit 8c26342cd5
2 changed files with 7 additions and 3 deletions

View File

@ -136,7 +136,11 @@ export default async function createServer(root = '', conf = {}) {
if (isIndex) { if (isIndex) {
res.setHeader('content-type', MIME_TYPES.html) res.setHeader('content-type', MIME_TYPES.html)
res.writeHead(200, 'OK') res.writeHead(200, 'OK')
res.end('<ul>' + indexPage + '</ul>') res.end(
'<div>注意: 你看到这个页面, 仅在开发时可见。<br>仅为了方便开发多页应用时访问自己想要修改的页面, 而不需要手动输入地址。</div><ul>' +
indexPage +
'</ul>'
)
} else { } else {
res.setHeader('accept-ranges', 'bytes') res.setHeader('accept-ranges', 'bytes')
@ -313,7 +317,7 @@ export default async function createServer(root = '', conf = {}) {
console.log( console.log(
' 本地: %s://%s:%d%s', ' 本地: %s://%s:%d%s',
USE_HTTPS ? 'https' : 'http', USE_HTTPS ? 'https' : 'http',
'127.0.0.1', USE_HTTPS ? 'localhost' : '127.0.0.1',
PORT, PORT,
DEPLOY_PATH DEPLOY_PATH
) )

View File

@ -1,7 +1,7 @@
{ {
"name": "fite", "name": "fite",
"type": "module", "type": "module",
"version": "1.0.2", "version": "1.0.3",
"bin": { "bin": {
"fite": "index.js" "fite": "index.js"
}, },