diff --git a/index.js b/index.js index 666f08f..8c14966 100644 --- a/index.js +++ b/index.js @@ -74,6 +74,10 @@ function createServer() { pathname = decode(pathname) || 'index.html' + if (pathname.endsWith('/')) { + pathname += 'index.html' + } + let file = join(root, pathname) let stat = fs.stat(file) let ext = pathname.split('.').pop() diff --git a/package.json b/package.json index 1916869..a9dfc41 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "simple-http", "displayName": "simple http", "description": "🔥 简单的http服务器, 方便临时调试html", - "version": "1.2.1", + "version": "1.2.2", "publisher": "yutent", "author": "Yutent [@yutent]", "icon": "logo.png",