在http服务器中启用目录列表

问题描述 投票:0回答:2

我刚刚通过以下方式安装了http-server

npm install --global http-server

我想设置一台服务器,该服务器将向我显示我的目录列表,以进行测试和学习。我已经尝试过:

[-d显示目录列表(默认为true

[-i显示自动索引(默认为true

但是创建服务器后,它始终会打开index.html而不是目录列表。

这或多或少是我想要获得的,而不是打开index.html:directory listing

我想实现的目标:screenshot

npm httpserver
2个回答
0
投票

这应该可以正常工作

npm install http-server -g
cd Directory/
http-server

如果您不想使用Http服务器,请在此answer上关注>>


0
投票

[-i显示自动索引(默认为true

© www.soinside.com 2019 - 2024. All rights reserved.