whatisgithub

What is http-server?

http-party/http-server — explained in plain English

Analysis updated 2026-06-24

14,179JavaScriptAudience · developerComplexity · 1/5Setup · easy

In one sentence

Zero-configuration command-line tool that instantly serves any folder as a website over HTTP, one command turns your local files into a web server viewable in any browser.

Mindmap

mindmap
  root((http-server))
    What it does
      Serve static files
      Zero configuration
      Local web preview
    Tech Stack
      Node.js
      npm
      Docker optional
    Options
      Custom port
      HTTPS support
      Basic auth
      Proxy requests
    Use cases
      Preview HTML builds
      Share files locally
      Single-page app testing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Preview a static HTML or React build folder in a browser without setting up a full development environment

USE CASE 2

Share a folder of files over your local network during a demo, workshop, or pair programming session

USE CASE 3

Serve a single-page app locally with a custom 404.html fallback so client-side routing works correctly

What is it built with?

JavaScriptNode.jsnpmDocker

How does it compare?

http-party/http-serverangular-ui/bootstrapunbug/codelf
Stars14,17914,17714,173
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyeasyeasy
Complexity1/52/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
License terms not specified in the explanation.

So what is it?

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.

Copy-paste prompts

Prompt 1
Serve my ./dist folder on port 3000 with directory listings disabled and brotli compression enabled using http-server
Prompt 2
How do I enable HTTPS in http-server for local testing, walk me through creating a self-signed certificate with OpenSSL
Prompt 3
Set up http-server to proxy all /api requests to http://localhost:4000 while serving static files from ./public
Prompt 4
Add basic username and password protection to my local http-server and set a custom cache TTL of one hour

Frequently asked questions

What is http-server?

Zero-configuration command-line tool that instantly serves any folder as a website over HTTP, one command turns your local files into a web server viewable in any browser.

What language is http-server written in?

Mainly JavaScript. The stack also includes JavaScript, Node.js, npm.

What license does http-server use?

License terms not specified in the explanation.

How hard is http-server to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is http-server for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.