Skip to content

Commit 0568097

Browse files
authoredApr 27, 2020
Merge pull request #517 from http-party/man_page
2 parents 021e9f5 + 95119c6 commit 0568097

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed
 

‎doc/http-server.1

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
.TH http-server 1 "April 2020" GNU "http-server man page"
2+
3+
.SH NAME
4+
http-server \- a simple zero-configuration command-line http server
5+
6+
.SH SYNOPSIS
7+
.B http-server
8+
[\fIPATH\fR]
9+
[\fIOPTIONS\fR]
10+
11+
.SH DESCRIPTION
12+
\fBhttp-server\fR is a simple, zero-configuration command-line http server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development, and learning.
13+
14+
.SH OPTIONS
15+
16+
.TP
17+
.BI [\fIPATH\fR]
18+
The directory to serve.
19+
Defaults to ./public if it exists, and ./ otherwise.
20+
21+
.TP
22+
.BI \-p ", " \-\-port " " \fIPORT\fR
23+
Port to use.
24+
Default is 8080.
25+
26+
.TP
27+
.BI \-a " " \fIADDRESS\fR
28+
Address to use.
29+
Default is 0.0.0.0.
30+
31+
.TP
32+
.BI \-d
33+
Show directory listings.
34+
Default is true.
35+
36+
.TP
37+
.BI \-i
38+
Display autoIndex.
39+
Default is true.
40+
41+
.TP
42+
.BI \-g ", " \-\-gzip
43+
Serve gzip files when possible.
44+
Default is false.
45+
46+
.TP
47+
.BI \-b ", " \-\-brotli
48+
Serve brotli files when possible.
49+
If both brotli and gzip are enabled, brotli takes precedence.
50+
Default is false.
51+
52+
.TP
53+
.BI \-e ", " \-\-ext " " \fIEXTENSION\fR
54+
Default file extension is none is provided.
55+
56+
.TP
57+
.BI \-s ", " \-\-silent
58+
Suppress log messages from output.
59+
60+
.TP
61+
.BI \-\-cors " " [\fIHEADERS\fR]
62+
Enable CORS via the "Access-Control-Allow-Origin" header.
63+
Optionally provide CORS headers list separated by commas.
64+
65+
.TP
66+
.BI \-o " " [\fIPATH\fR]
67+
Open default browser window after starting the server.
68+
Optionally provide a URL path to open the browser window to.
69+
70+
.TP
71+
.BI \-c " " \fITIME\fR
72+
Cache time (max-age) in seconds.
73+
To disable caching, use \-c \-1.
74+
Default is 3600.
75+
76+
.TP
77+
.BI \-U ", " \-\-utc
78+
Use UTC time format in log messages.
79+
80+
.TP
81+
.BI \-\-log\-ip
82+
Enable logging of the client IP address.
83+
84+
.TP
85+
.BI \-P ", " \-\-proxy
86+
Fallback proxy if the request cannot be resolved.
87+
88+
.TP
89+
.BI \-\-username " " \fIUSERNAME\fR
90+
Username for basic authentication.
91+
Can also be specified with the environment variable NODE_HTTP_SERVER_USERNAME.
92+
Defaults to none.
93+
94+
.TP
95+
.BI \-\-password " " \fIPASSWORD\fR
96+
Password for basic authentication.
97+
Can also be specified with the environment variable NODE_HTTP_SERVER_PASSWORD.
98+
Defaults to none.
99+
100+
.TP
101+
.BI \-S ", " \-\-ssl
102+
Enable https.
103+
104+
.TP
105+
.BI \-C ", " \-\-cert " " [\fIFILE\fR]
106+
Path to SSL certificate file.
107+
If not specified, uses cert.pem.
108+
109+
.TP
110+
.BI \-K ", " \-\-key " " [\fIFILE\fR]
111+
Path to SSL key file.
112+
If not specified, uses key.pem.
113+
114+
.TP
115+
.BI \-r ", " \-\-robots " " [\fIUSER\-AGENT\fR]
116+
Respond to /robots.txt request.
117+
If not specified, uses "User-agent: *\\nDisallow: /]"
118+
119+
.TP
120+
.BI \-\-no\-dotfiles
121+
Do not show dotfiles.
122+
123+
.TP
124+
.BI \-h ", " \-\-help
125+
Print usage and exit.
126+
127+
.TP
128+
.BI \-v ", " \-\-version
129+
Print version and exit.
130+
131+
.SH FILES
132+
.B index.html
133+
will be served as the default file to any directory requests.
134+
135+
.B 404.html
136+
will be served if a file is not found. This can be used for SPA hosting to serve the entry page.
137+
138+
.SH COPYING
139+
Copyright (c) 2011-2020 Charlie Robbins, Marak Squires, and the Contributors.
140+
Permission is hereby granted, free of charge, to any person obtaining
141+
a copy of this software and associated documentation files (the
142+
"Software"), to deal in the Software without restriction, including
143+
without limitation the rights to use, copy, modify, merge, publish,
144+
distribute, sublicense, and/or sell copies of the Software, and to
145+
permit persons to whom the Software is furnished to do so, subject to
146+
the following conditions:
147+
148+
The above copyright notice and this permission notice shall be
149+
included in all copies or substantial portions of the Software.
150+
151+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
152+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
153+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
154+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
155+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
156+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
157+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
158+
159+
.SH VERSION
160+
Version 0.12.2

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"lib",
2323
"bin"
2424
],
25+
"man": "./doc/http-server.1",
2526
"engines": {
2627
"node": ">=6"
2728
},

0 commit comments

Comments
 (0)
Please sign in to comment.