Skip to content

Disable directory listing #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jceb opened this issue Mar 27, 2024 · 2 comments
Open

Disable directory listing #108

jceb opened this issue Mar 27, 2024 · 2 comments

Comments

@jceb
Copy link

jceb commented Mar 27, 2024

Is it possible to disable the directory listing? I'm using version 0.6.9 on Nix and the directory listing appears to be always on despite me not providing the -i flag.

@soenkehahn
Copy link

I think the -i flag means that simple-http-server will serve index.html files instead of the file listing if they exist. If they don't exist, the -i flag doesn't change anything.

I would also like to be able to disable the file listing.

Of course there's workarounds: make sure an index.html file exists and pass -i. And maybe --try-file will also achieve this? But it'd be nice to just have a cli flag.

@georgefst
Copy link

georgefst commented Apr 12, 2025

This would actually be great in conjunction with --try-file, because it would allow redirecting the root path to that file as well. Combine all that with --open and you've basically got a way to open an HTML file on the command line while also serving required static assets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants