http-party/http-server ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple command line static file server that I can run from any folder and just have it work with no setup.

It should serve the current directory by default, or a chosen folder if I pass one in, and I want it to open on localhost so I can browse files in the browser right away. If a folder has an index.html, show that automatically, and if a file is missing, serve a 404 page when one exists. Please include directory listings, basic caching, and options to turn caching off. I also want a few useful flags, like changing the port, setting the host address, adding custom response headers, enabling CORS, serving gzip or brotli files when they exist, and optionally running over HTTPS with my cert and key files.

It would be great if it can also support simple basic auth, proxy missing requests to another URL, hide dotfiles, and open the browser after startup. Keep it easy to use from the terminal, and make the defaults sensible.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab