Development web server in a single Java source file on top of the JDK's built-in jdk.httpserver: serves static files, disables caching, and opens the browser automatically.
Java 25 or later
curl -O https://raw.githubusercontent.com/AdamBien/zws/main/zws
chmod +x zws
./zws [root-directory]The file has no .java extension, so launching it with java directly requires the source flag: java --source 25 zws [root-directory] — or use zws.sh, which does exactly that. Copy zws and zws.sh to a directory in your PATH for system-wide use.
- Serves files from the current directory (or the specified root)
- Listens on
http://localhost:3000(loopback only) - Opens the default browser
- Sends no-cache headers on every response
Pass --single to serve SPAs with client-side routing:
./zws [root-directory] --singleGET requests for paths that do not exist on disk and have no file extension (client-side routes like /add) are answered with index.html, so deep links and reloads reach the application. Requests with a file extension (assets) still return 404, keeping typos visible.
Pass --live to reload connected browsers on file changes:
./zws [root-directory] --liveThe site root is watched recursively, and served HTML pages get a one-line script injected before the closing body tag that listens on the /reload server-sent events endpoint and calls location.reload() on every change — pure web standards, no WebSockets, no client library. --live composes with --single: SPA-fallback responses reload too.
bce.design — vanilla WebComponents
ZWS is also bundled as the local dev server in airails.dev skills.
powered by airhacks.industries
