serve-static
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -0,1 +1,13 @@ | ||
1.4.0 / 2014-07-21 | ||
================== | ||
* deps: parseurl@~1.2.0 | ||
- Cache URLs based on original value | ||
- Remove no-longer-needed URL mis-parse work-around | ||
- Simplify the "fast-path" `RegExp` | ||
* deps: send@0.7.0 | ||
- Add `dotfiles` option | ||
- deps: debug@1.0.4 | ||
- deps: depd@0.4.2 | ||
1.3.2 / 2014-07-11 | ||
@@ -5,2 +17,3 @@ ================== | ||
* deps: send@0.6.0 | ||
- Cap `maxAge` value to 1 year | ||
- deps: debug@1.0.3 | ||
@@ -7,0 +20,0 @@ |
{ | ||
"name": "serve-static", | ||
"description": "Serve static files", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
@@ -10,4 +10,4 @@ "license": "MIT", | ||
"escape-html": "1.0.1", | ||
"parseurl": "~1.1.3", | ||
"send": "0.6.0" | ||
"parseurl": "~1.2.0", | ||
"send": "0.7.0" | ||
}, | ||
@@ -14,0 +14,0 @@ "devDependencies": { |
@@ -7,4 +7,2 @@ # serve-static | ||
Previously `connect.static()`. | ||
## Install | ||
@@ -26,12 +24,47 @@ | ||
directory. The file to serve will be determined by combining `req.url` | ||
with the provided root directory. | ||
with the provided root directory. When a file is not found, instead of | ||
sending a 404 response, this module will instead call `next()` to move on | ||
to the next middleware, allowing for stacking and fall-backs. | ||
Options: | ||
#### Options | ||
- `hidden` Allow transfer of hidden files. defaults to `false` | ||
- `index` Default file name, defaults to `'index.html'` | ||
- `maxAge` Browser cache maxAge in milliseconds. This can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) module. defaults to `0` | ||
- `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to `true` | ||
- `setHeaders` Function to set custom headers on response. | ||
##### dotfiles | ||
Set how "dotfiles" are treated when encountered. A dotfile is a file | ||
or directory that begins with a dot ("."). Note this check is done on | ||
the path itself without checking if the path actually exists on the | ||
disk. If `root` is specified, only the dotfiles above the root are | ||
checked (i.e. the root itself can be within a dotfile when when set | ||
to "deny"). | ||
The default value is `'ignore'`. | ||
- `'allow'` No special treatment for dotfiles. | ||
- `'deny'` Send a 403 for any request for a dotfile. | ||
- `'ignore'` Pretend like the dotfile does not exist and call `next()`. | ||
##### etag | ||
Enable or disable etag generation, defaults to true. | ||
##### index | ||
By default this module will send "index.html" files in response to a request | ||
on a directory. To disable this set `false` or to supply a new index pass a | ||
string or an array in preferred order. | ||
##### maxAge | ||
Provide a max-age in milliseconds for http caching, defaults to 0. This | ||
can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme) | ||
module. | ||
##### redirect | ||
Redirect to trailing "/" when the pathname is a dir. Defaults to `true`. | ||
##### setHeaders | ||
Function to set custom headers on response. | ||
## Examples | ||
@@ -38,0 +71,0 @@ |
11073
144
+ Addeddebug@1.0.4(transitive)
+ Addeddepd@0.4.2(transitive)
+ Addedparseurl@1.2.0(transitive)
+ Addedsend@0.7.0(transitive)
- Removeddebug@1.0.3(transitive)
- Removeddepd@0.3.0(transitive)
- Removedparseurl@1.1.3(transitive)
- Removedsend@0.6.0(transitive)
Updatedparseurl@~1.2.0
Updatedsend@0.7.0