Use cases
Real-world ways teams use servd for development, testing, and lightweight hosting.
Preview a local build
Point servd at dist/, build/ or _site/ to preview a production build in one command — no Node runtime, correct caching and gzip/brotli out of the box.
Local debug proxy (SPA + API + WebSocket)
Put your front-end build and back-end behind one port while debugging locally. servd serves the SPA, rewrites /api to your server, and tunnels /ws — the browser sees a single origin and no CORS setup is needed.
Lightweight hosting
Point one static binary at a folder and keep it served — internal tools, demos, coverage reports or small sites — with optional TLS, host filtering and a self-restarting daemon.
Local HTTPS & WSS preview
Some browser features only work in a secure context. servd terminates TLS 1.2+ from a PEM cert and key so you can test service workers, secure cookies, geolocation and wss:// locally.
An always-on demo or tool
servd --daemon detaches a supervised instance scoped per user and port. It restarts a crashed worker with backoff, logs to a rotating file, and is controlled with --status and --stop.
CI artifacts & container previews
servd is one self-contained Go binary with no Node or libc runtime needs. Drop it into a scratch/distroless image or a CI job to serve artifacts, preview deployments and smoke-test a build.