http-server
A simple, zero-configuration, command-line http server
What is http-server?
A simple, zero-configuration, command-line http server
Overview of http-server
What it is
http-server is a simple, zero-configuration command-line static HTTP server. It is powerful enough for production usage, but also simple and hackable enough for testing, local development, and learning.
Key features
- Zero configuration: run with a single command and default settings.
- Serves static files from a specified directory (defaults to
./publicif it exists, otherwise./). - Supports directory listings, auto-index, and magic files (
index.html,404.html). - Options for TLS/SSL (HTTPS), CORS, gzip/brotli compression, caching control, and proxy.
- Can be installed globally via npm, Homebrew, or run on-demand with npx.
- Docker support (build your own image using the provided Dockerfile).
Use cases
- Serving static websites or single-page applications during development.
- Quick file sharing over a local network.
- Testing and prototyping without complex server setup.
- Lightweight production serving for small static sites.
Getting started
Install globally via npm:
npm install --global http-server
Or run on-demand with npx:
npx http-server [path] [options]
Start the server in the current directory:
http-server
Then visit http://localhost:8080.
License and pricing
Licensed under the MIT License. It is open source and free to use.
Based on the project's public README and repository metadata.