Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable directory listing in http-server

Tags:

npm

httpserver

I've just installed http-server via:

npm install --global http-server

I want to set up a server that will show me my directory listing for testing and learning purposes. I've already experimented with:

-d Show directory listings (defaults to true)

-i Display autoIndex (defaults to true)

But all the time after creating a server it opens index.html instead of directory listing.

This is more or less what I'd like to get instead of opening index.html:

directory listing

What I would like to achieve:

screenshot

like image 274
sitek94 Avatar asked Sep 14 '25 18:09

sitek94


1 Answers

-i Display autoIndex (defaults to true)

This is what makes http-server display the index (enabled by default), you can turn this off like that:

http-server -i false
like image 121
Mickael B. Avatar answered Sep 17 '25 17:09

Mickael B.