Skip to content

Commit 1acf81f

Browse files
committed
docs: Remove now redundant install section, make defaults visible in semantically marked-up headings and add CLI options; closes #177
1 parent 7d3e87d commit 1acf81f

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

README.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ of an error.
154154

155155
### Options when creating an instance of `Server`
156156

157-
#### `cache`
157+
#### `cache` (Default: `3600`)
158158

159159
Sets the `Cache-Control` header.
160160

@@ -166,26 +166,19 @@ Passing `false` will disable the `Cache-Control` header.
166166
Passing a object with [minimatch glob pattern](https://github.com/isaacs/minimatch)
167167
keys and number values will set cache max-age for any matching paths.
168168

169-
> Defaults to `3600`
170-
171-
172-
#### `serverInfo`
169+
#### `serverInfo` (Default: `node-static/{version}`)
173170

174171
Sets the `Server` header.
175172

176173
example: `{ serverInfo: "myserver" }`
177174

178-
> Defaults to `node-static/{version}`
179-
180-
#### `headers`
175+
#### `headers` (Default: `{}`)
181176

182177
Sets response headers.
183178

184179
example: `{ headers: { 'X-Hello': 'World!' } }`
185180

186-
> defaults to `{}`
187-
188-
#### `gzip`
181+
#### `gzip` (Default: `false`)
189182

190183
Enable support for sending compressed responses. This will enable a check for
191184
a file with the same name plus '.gz' in the same folder. If the compressed
@@ -201,35 +194,36 @@ Passing `true` will enable this check for all files.
201194
Passing a RegExp instance will only enable this check if the content-type of
202195
the respond would match that RegExp using its test() method.
203196

204-
> Defaults to `false`
205-
206-
#### `indexFile`
197+
#### `indexFile` (Default: `index.html`)
207198

208199
Choose a custom index file when serving up directories.
209200

210201
example: `{ indexFile: "index.htm" }`
211202

212-
> Defaults to `index.html`
213-
214-
#### `defaultExtension`
203+
#### `defaultExtension` (Default: `null`)
215204

216205
Choose a default extension when serving files.
217206
A request to '/myFile' would check for a `myFile` folder (first) then a
218207
`myFile.html` (second).
219208

220209
example: `{ defaultExtension: "html" }`
221210

222-
> Defaults to `null`
223-
224-
225211
## Command Line Interface
226212

227213
`node-static` also provides a CLI.
228214

229-
### Installation
230-
231-
```sh
232-
$ npm install -g node-static
215+
```text
216+
--port, -p TCP port at which the files will be served [default: 8080]
217+
--host-address, -a the local network interface at which to listen [default: "127.0.0.1"]
218+
--cache, -c "Cache-Control" header setting, defaults to 3600
219+
--version, -v node-static version
220+
--headers, -H additional headers (in JSON format)
221+
--header-file, -f JSON file of additional headers
222+
--gzip, -z enable compression (tries to serve file of same name plus '.gz')
223+
--spa Serve the content as a single page app by redirecting all
224+
non-file requests to the index HTML file.
225+
--indexFile, -i Specify a custom index file when serving up directories. [default: "index.html"]
226+
--help, -h display this help message
233227
```
234228

235229
### Example Usage

0 commit comments

Comments
 (0)