Illustration by Nomi, [@the_nomi, mail]
servez is a simple, zero-configuration command-line http server for development and learning. Note there is also an app version for those who prefer GUIs.
!!!Note!!!: you need to install node.js. I recommend installing node via nvm(mac/linux) or nvm-windows(windows)
Installation via npm:
npm install servez -g
This will install servez globally so you can run it from the command line.
Using npx you can run servez without installing it first:
npx servez [options] [path]
servez [options] [path]
[path] defaults to the current folder.
You can now visit http://localhost:8080
-
-hor--helpfor help -
-por--portPort to use (defaults to 8080) note if port is in use will use next available port -
--versionprints the version number -
--scanscan forward until an open port is found. (defaults totrue.--no-scanto disable) -
--dirsShow folder listings (defaults totrue,--no-dirsto disable) -
--qrShow a QR code for the root url of the server. This might help for using servez with a phone. -
--corsInclude CORS headers (defaults totrue,--no-corsto disable) -
--localmake serve only accessible from this machine. The default is to serve publicly. (0.0.0.0 vs 127.0.0.1) -
--indexDisplay index.html for folders if it exists (defaults totrue,--no-indexto disable) -
--gzipservesomefile.gzin place ofsomefile -
--brotliservesomefile.brin place ofsomefile -
--unity-hackignore .gz and .br when computing content type. (defaults totrue,--no-unity-hackto disable) -
--shared-array-buffersinclude headers 'Cross-Origin-Opener-Policy': 'same-origin' and 'Cross-Origin-Embedder-Policy': 'require-corp'. -
--header=<name>:<value>extra headers to include eg--header=Content-Language:de-DE' -
--robotsProvide a /robots.txt if one does not exist. (defaults totrue.--no-robotsto disable) -
--hiddenShow files that start with. -
--usernameUsername for basic authentication -
--passwordPassword for basic authentication -
-Sor--sslUse https (will use a fake cert if not specified) -
-Cor--certPath to ssl cert file -
-Kor--keyPath to ssl key file
Cortez, Hernández, Gomez, Ramírez, and Servez walked into a bar...