One binary. Zero runtime dependencies.

Serve static, SPA, proxy and WebSocket — from a single binary.

servd is a self-contained development, testing and lightweight hosting server — a drop-in alternative to http-server with first-class proxies, TLS and a self-supervising daemon.

Install

npm install --global @qingyu31/servd
servd
$ servd --spa=./frontend --proxy=/api/=http://localhost:9000/api/ --ws=/ws=ws://localhost:9000/ws --port=8080servd 0.1.0 listening on 0.0.0.0:8080 (all IPv4 interfaces)Hosts: unrestricted  spa / -> /app/frontend  proxy /api -> http://localhost:9000/api/  proxy /ws -> ws://localhost:9000/ws

Why servd

Zero configuration

No config file and no required flags: run servd and it serves the current directory. Everything else is opt-in per-mount flags.

Static & SPA

Serve one or more directories at mount prefixes, with content-negotiated SPA fallback to index.html.

HTTP proxy

Forward a mount prefix to an upstream URL with path rewriting. Longest mount wins; proxies beat files.

WebSocket proxy

Tunnel ws:// and wss:// upstreams through the same port as your static site and API.

HTTPS & WSS

Terminate TLS 1.2+ from a PEM cert and key. The port serves both HTTPS and WSS over HTTP/1.1.

CORS & host filters

Allow a wildcard or explicit origins (no credentials), and restrict which Host headers are accepted.

Daemon mode

Run detached with a supervisor that restarts a crashed worker using exponential backoff.

Zero dependencies

A single static binary distributed via npm as per-platform packages. No Node runtime needed to serve.

How it compares to http-server and nginx

Capabilityhttp-servernginxservd
Zero-config startYes (single root)No (needs a config file)Yes (serves the current directory)
Config file & reloadFlags onlynginx.conf + reloadNone; flags only
Multiple HTTP proxy mountsNo (single --proxy fallback)Yes (location blocks)Yes (--proxy, repeatable)
Proxy path rewritingNoYes (rewrite)Yes (mount=target)
WebSocket proxyNoYes (Upgrade headers)Yes (--ws)
SPA fallbackBasicYes (try_files)Yes (content-negotiated)
CORSYesManual headersYes (--cors)
TLS / HTTPSYesYesYes (TLS 1.2+, HTTP/1.1)
Background daemon with restartNoYes (master/worker)Yes (--daemon)
Runtime & learning curveNode.js; lowSeparate server; steepNone (single static binary); low

Use cases

View all

From the blog

View all
servd

A tiny static, SPA, HTTP and WebSocket server in one Go binary.

Product

Resources

© 2026 servd. Released under the MIT-style terms in the repository. Docs site built with SvelteKit and served by servd.