Servez is a straightforward command-line HTTP server designed for local development and learning, serving static files quickly. As of version 2.4.0, it offers zero-configuration defaults but provides a rich set of options for customization, including port selection, directory listing, CORS headers, gzip/brotli compression, and basic authentication. Its primary differentiator is its simplicity and ease of use, aiming to replace tools like `http-server` with a modern, actively maintained alternative. It supports both HTTP and HTTPS (with self-signed or custom certificates) and can display QR codes for easy mobile access. The project appears to have a regular, albeit not fixed, release cadence, driven by user needs and feature enhancements, making it a reliable choice for development server needs.
npm install servezVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to programmatically start `servez` from a Node.js script, creating a public directory with sample content and serving it on port 8080 with directory listings, CORS, QR code, and local access enabled.
Always include `--local` if you intend for the server to be accessible only from `127.0.0.1` (localhost).
For secure development, either configure your browser to trust the self-signed certificate, or provide valid, trusted certificates using `--cert` and `--key`.
Check the server output in the terminal to confirm the exact port being used, or explicitly specify a port with `--port <number>`.
Install Node.js via `nvm` (mac/linux) or `nvm-windows` (windows) before attempting to install or run `servez`.
Install it globally via `npm install -g servez` or execute it directly using `npx servez`.
Ensure `servez` is running and check the console output for the correct URL (e.g., `http://localhost:8080` or the next available port). If using `--local`, confirm you're accessing `127.0.0.1`.
Start `servez` with the `--cors` option to enable CORS headers: `servez --cors`.
For development, you can usually proceed past the browser warning. For a trusted setup, provide your own valid SSL certificate and key files using `--cert <path_to_cert>` and `--key <path_to_key>`.
No dependency data recorded yet.