Preview a static HTML or React build folder in a browser without setting up a full development environment
Share a folder of files over your local network during a demo, workshop, or pair programming session
Serve a single-page app locally with a custom 404.html fallback so client-side routing works correctly
http-server is a small command-line program that serves files from a folder over the web. The README describes it as a simple, zero-configuration static HTTP server. In plain terms, you point it at a folder on your computer and it makes the files in that folder available in a web browser, usually at http://localhost:8080. 'Zero-configuration' means you do not have to set up a config file first, you just run one command. 'Static' means it serves files as they are, such as HTML, images, and scripts, rather than generating pages on the fly. The README says it is simple enough for testing, local development, and learning, while still being capable enough for production use. This makes it a common choice when someone just wants to preview a website they are building, or share a folder of files quickly. Installing it is flexible. You can run it without installing through npx http-server, install it globally with npm or Homebrew so it is available anywhere from the command line, add it as a dependency in a project, or build a Docker image from the included Dockerfile. Once running, the path you give defaults to a ./public folder if it exists and otherwise the current folder. A large part of the README is a table of options. These let you change the port and address, turn directory listings on or off, enable gzip or brotli compression, set how long files are cached, add custom response headers, require a username and password, and proxy requests that cannot be served locally to another URL. There are also notes on two 'magic' files: index.html is served by default for a folder, and 404.html is shown when a file is not found, which is handy for single-page apps. The final sections explain how to enable HTTPS using OpenSSL to create a certificate and key, then running the server with the secure options.
← http-party on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.