http-server(1)
π http-server(1) β the manual, but make it cute π
okay bestie, gather round, because today we're talking about http-server β it's a manual page for your new favorite little command, and yes it lives in section 1 of the manual (the "commands you type at a shell" section, iykyk). it's a simple, zero-configuration command-line http server. that's the whole vibe. let's go π¦
πΈ NAME πΈ
http-server β a simple zero-configuration command-line http server β¨
π SYNOPSIS π
http-server [PATH] [OPTIONS]
that's it. that's the whole summoning ritual. π
π«Ά DESCRIPTION π«Ά
so http-server is a simple, zero-configuration command-line http server. no cap. you don't gotta write a config file, you don't gotta set up a framework, you just point it at some files and it serves them. iconic behavior.
and here's the thing β it's genuinely powerful enough for production usage, but it's also simple and hackable enough to be used for testing, local development, and learning. so like. it can do the big serious job AND it can be your lil study buddy. main character energy fr fr. π
β¨ OPTIONS β¨
okay here's the full menu, no skips, no cuts, every single one:
[PATH]β the directory to serve. defaults to./publicif that exists, and./otherwise. so if you got apublicfolder it's gonna assume that's the one. π-p,--port PORTβ which port to use. if you pass0, it goes looking for the first available port, starting at8080. default is8080. π-a ADDRESSβ the address to use. default is0.0.0.0. (that's the "everybody come on in" address, bestie.)-dβ show directory listings. default istrue. yes queen, list them directories.-iβ display autoIndex. default istrue.-g,--gzipβ serve gzip files when possible. default isfalse.-b,--brotliβ serve brotli files when possible. if both brotli and gzip are enabled, brotli takes precedence. default isfalse.-e,--ext EXTENSIONβ default file extension when none is provided.-s,--silentβ suppress log messages from output. quiet mode, shhh. π€«--cors [HEADERS]β enable CORS via the"Access-Control-Allow-Origin"header. optionally you can hand it a CORS headers list separated by commas.-o [PATH]β open the default browser window after starting the server. optionally you can give it a URL path to open the browser window to. so it just... opens itself. show-off. π-c TIMEβ cache time (max-age) in seconds. to disable caching, use-c -1. default is3600.-U,--utcβ use UTC time format in log messages.--log-ipβ enable logging of the client IP address.-P,--proxyβ fallback proxy if the request cannot be resolved.--proxy-optionsβ pass proxy options using nested dotted objects.--username USERNAMEβ username for basic authentication. can also be specified with the environment variableNODE_HTTP_SERVER_USERNAME. defaults to none.--password PASSWORDβ password for basic authentication. can also be specified with the environment variableNODE_HTTP_SERVER_PASSWORD. defaults to none.-S,--tls,--sslβ enable https. π-C,--cert [FILE]β path to the SSL certificate file. if not specified, usescert.pem.-K,--key [FILE]β path to the SSL key file. if not specified, useskey.pem. the passphrase will be read fromNODE_HTTP_SERVER_SSL_PASSPHRASE(if set).-r,--robots [USER-AGENT]β respond to/robots.txtrequests. if not specified, uses"User-agent: *\nDisallow: /]".--no-dotfilesβ do not show dotfiles. π-h,--helpβ print usage and exit. your lil helper.-v,--versionβ print version and exit.
π¦ FILES π¦
index.htmlwill be served as the default file to any directory requests. it's the welcoming committee. π404.htmlwill be served if a file is not found. this can be used for SPA hosting to serve the entry page. so when something's missing, this is what shows up instead of a sad default error. πβ‘οΈπ
π COPYING π
Copyright (c) 2011-2022 Charlie Robbins, Marak Squires, and the Contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
bestie that's the legal bit and we do not mess with the legal bit. all caps means it MEANS it. π read it, respect it, move on. π«Ά
β VERSION β
Version 0.12.2 β¨
and that's the whole page, bestie!! this manual came from the GNU fam and it's dated April 2020 β so go forth, serve some files, and be the zero-config icon you were born to be. slay, periodt, no cap ππΈππ¦β¨
π¦ where this page comes from
- debian bookworm: node-http-server 14.1.1+~cs3.14.34-2 Β· MIT
- debian trixie: node-http-server 14.1.1+~cs3.16.36-1 Β· MIT
- nixos 26.05: http-server 14.1.1
- nixpkgs unstable: http-server 14.1.1
- ubuntu noble: node-http-server 14.1.1+~cs3.14.34-2 Β· MIT
- ubuntu questing: node-http-server 14.1.1+~cs3.16.36-1
- ubuntu resolute: node-http-server 14.1.1+~cs3.16.39-1 Β· MIT
- ubuntu stonking: node-http-server 14.1.1+~cs3.16.39-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms