Socket
Socket
Sign inDemoInstall

serve-static

Package Overview
Dependencies
11
Maintainers
6
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.2 to 1.4.0

13

History.md

@@ -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 @@

6

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc