sistema creado v0.5.0
This commit is contained in:
16
api/node_modules/serve-static/README.md
generated
vendored
16
api/node_modules/serve-static/README.md
generated
vendored
@@ -2,7 +2,8 @@
|
||||
|
||||
[![NPM Version][npm-version-image]][npm-url]
|
||||
[![NPM Downloads][npm-downloads-image]][npm-url]
|
||||
[![CI][github-actions-ci-image]][github-actions-ci-url]
|
||||
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
|
||||
[![Windows Build][appveyor-image]][appveyor-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
## Install
|
||||
@@ -44,7 +45,7 @@ true. Disabling this will ignore the `immutable` and `maxAge` options.
|
||||
|
||||
##### dotfiles
|
||||
|
||||
Set how "dotfiles" are treated when encountered. A dotfile is a file
|
||||
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
|
||||
@@ -55,7 +56,8 @@ to "deny").
|
||||
- `'deny'` Deny a request for a dotfile and 403/`next()`.
|
||||
- `'ignore'` Pretend like the dotfile does not exist and 404/`next()`.
|
||||
|
||||
The default value is `'ignore'`.
|
||||
The default value is similar to `'ignore'`, with the exception that this
|
||||
default will not ignore the files within a directory that begins with a dot.
|
||||
|
||||
##### etag
|
||||
|
||||
@@ -213,7 +215,7 @@ app.listen(3000)
|
||||
#### Different settings for paths
|
||||
|
||||
This example shows how to set a different max age depending on the served
|
||||
file. In this example, HTML files are not cached, while everything else
|
||||
file type. In this example, HTML files are not cached, while everything else
|
||||
is for 1 day.
|
||||
|
||||
```js
|
||||
@@ -230,8 +232,8 @@ app.use(serveStatic(path.join(__dirname, 'public'), {
|
||||
|
||||
app.listen(3000)
|
||||
|
||||
function setCustomCacheControl (res, file) {
|
||||
if (path.extname(file) === '.html') {
|
||||
function setCustomCacheControl (res, path) {
|
||||
if (serveStatic.mime.lookup(path) === 'text/html') {
|
||||
// Custom Cache-Control for HTML files
|
||||
res.setHeader('Cache-Control', 'public, max-age=0')
|
||||
}
|
||||
@@ -242,6 +244,8 @@ function setCustomCacheControl (res, file) {
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[appveyor-image]: https://badgen.net/appveyor/ci/dougwilson/serve-static/master?label=windows
|
||||
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static
|
||||
[coveralls-image]: https://badgen.net/coveralls/c/github/expressjs/serve-static/master
|
||||
[coveralls-url]: https://coveralls.io/r/expressjs/serve-static?branch=master
|
||||
[github-actions-ci-image]: https://badgen.net/github/checks/expressjs/serve-static/master?label=linux
|
||||
|
||||
Reference in New Issue
Block a user