http-server
$ http-server Community Med Riskhttp-server (http-party/http-server) serves any local directory over HTTP/HTTPS with minimal setup (http-server ./dist -p 8080 --cors). Supports disabling caching (-c-1), SPA/API proxy fallback (-P), basic auth, and silent logging (-s), making it a staple quick local preview daemon.
brew install http-server http-server binds a local TCP port to serve static files from disk during local build previews or browser tests.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Accepts clean non-interactive flags (-p, -a, -c-1, --cors, -s), but runs as an indefinite blocking daemon and emits unstructured log lines with no --json mode.
- Long-running daemon process; must be backgrounded by the caller
- No
--jsonaccess log format
Read-only over HTTP, but binds 0.0.0.0 by default unless -a 127.0.0.1 is passed, which can expose the working directory on local networks.
- Defaults to
0.0.0.0unless-a 127.0.0.1is explicitly passed - Serves directory listings unless
-d falseis set
Widely available via npx http-server, npm install -g http-server, and brew install http-server on macOS, Linux, and Windows.
- Zero-install execution via
npx http-server
Instant static file server with -c-1, --cors, TLS (-S), and -P proxy fallback for quick frontend previews.
- Covers static hosting, CORS, TLS, basic auth, and simple proxying
Long-standing MIT community package (http-party/http-server).
- MIT-licensed
http-party/http-serverrepository
Clear README flag table and --help output.
- Documented CLI flags in repository README
Security, Auth & Guardrails
Stateless; optional HTTP basic auth accepts --username and --password on launch.
MIT open-source Node.js CLI; completely free.
# http-server Agent Rules - Always run `http-server` as a background daemon (it blocks forever until killed). - Bind `-a 127.0.0.1` instead of `0.0.0.0` so local files are not exposed on the LAN. - Pass `-c-1` during development/testing so stale `Cache-Control` headers do not confuse checks.
Agent-Ready Command Recipes
Safe Read-Only Queries
http-server ./dist -a 127.0.0.1 -p 8080 -c-1 --cors -s
Starts a static server bound to 127.0.0.1:8080 with caching disabled (-c-1), CORS enabled, and quiet logs (-s).
http-server ./public -a 127.0.0.1 -p 8080 -P http://127.0.0.1:3000
Serves static assets from ./public and proxies missing paths to a local API server.
Strengths for Agents
- + Zero-config static server (
npx http-server) with-c-1,--cors, and-Pproxy support. - + Available everywhere via npm and Homebrew.
Caveats & Pitfalls
- ! Blocking server daemon: hangs synchronous agent shell calls unless launched in the background and cleaned up afterward.
- ! Binds all interfaces (
0.0.0.0) and enables directory indexing by default unless-a 127.0.0.1and-d falseare passed.