Backend half
This commit is contained in:
+6
-35
@@ -1,48 +1,19 @@
|
||||
2.2.0 / 2025-03-27
|
||||
==================
|
||||
|
||||
* deps: send@^1.2.0
|
||||
|
||||
2.1.0 / 2024-09-10
|
||||
1.16.2 / 2024-09-11
|
||||
===================
|
||||
|
||||
* Changes from 1.16.0
|
||||
* deps: send@^1.2.0
|
||||
* deps: encodeurl@~2.0.0
|
||||
|
||||
2.0.0 / 2024-08-23
|
||||
==================
|
||||
1.16.1 / 2024-09-11
|
||||
===================
|
||||
|
||||
* deps:
|
||||
* parseurl@^1.3.3
|
||||
* excape-html@^1.0.3
|
||||
* encodeurl@^2.0.0
|
||||
* supertest@^6.3.4
|
||||
* safe-buffer@^5.2.1
|
||||
* nyc@^17.0.0
|
||||
* mocha@^10.7.0
|
||||
* Changes from 1.x
|
||||
|
||||
2.0.0-beta.2 / 2024-03-20
|
||||
=========================
|
||||
|
||||
* deps: send@1.0.0-beta.2
|
||||
|
||||
2.0.0-beta.1 / 2022-02-05
|
||||
=========================
|
||||
|
||||
* Change `dotfiles` option default to `'ignore'`
|
||||
* Drop support for Node.js 0.8
|
||||
* Remove `hidden` option; use `dotfiles` option instead
|
||||
* Remove `mime` export; use `mime-types` package instead
|
||||
* deps: send@1.0.0-beta.1
|
||||
- Use `mime-types` for file to content type mapping
|
||||
- deps: debug@3.1.0
|
||||
* deps: send@0.19.0
|
||||
|
||||
1.16.0 / 2024-09-10
|
||||
===================
|
||||
|
||||
* Remove link renderization in html while redirecting
|
||||
|
||||
|
||||
1.15.0 / 2022-03-24
|
||||
===================
|
||||
|
||||
|
||||
+10
-6
@@ -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
|
||||
|
||||
+1
@@ -26,6 +26,7 @@ var url = require('url')
|
||||
*/
|
||||
|
||||
module.exports = serveStatic
|
||||
module.exports.mime = send.mime
|
||||
|
||||
/**
|
||||
* @param {string} root
|
||||
|
||||
+10
-9
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "serve-static",
|
||||
"description": "Serve static files",
|
||||
"version": "2.2.0",
|
||||
"version": "1.16.2",
|
||||
"author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
|
||||
"license": "MIT",
|
||||
"repository": "expressjs/serve-static",
|
||||
"dependencies": {
|
||||
"encodeurl": "^2.0.0",
|
||||
"escape-html": "^1.0.3",
|
||||
"parseurl": "^1.3.3",
|
||||
"send": "^1.2.0"
|
||||
"encodeurl": "~2.0.0",
|
||||
"escape-html": "~1.0.3",
|
||||
"parseurl": "~1.3.3",
|
||||
"send": "0.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "7.32.0",
|
||||
@@ -19,9 +19,10 @@
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-promise": "5.2.0",
|
||||
"eslint-plugin-standard": "4.1.0",
|
||||
"mocha": "^10.7.0",
|
||||
"nyc": "^17.0.0",
|
||||
"supertest": "^6.3.4"
|
||||
"mocha": "9.2.2",
|
||||
"nyc": "15.1.0",
|
||||
"safe-buffer": "5.2.1",
|
||||
"supertest": "6.2.2"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
@@ -29,7 +30,7 @@
|
||||
"index.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
|
||||
Reference in New Issue
Block a user