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 ./public if 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.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/http-partyhttp-server.svg)](https://yunodb.com/tools/http-partyhttp-server?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/http-partyhttp-server?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/http-partyhttp-server.svg" alt="Featured on YunoDB" height="20"></a>