Skip to content

Commit 29e10c1

Browse files
authored
Merge branch 'gh-pages' into 1421-docs-clean
2 parents 0e581e1 + 10929d3 commit 29e10c1

File tree

19 files changed

+253
-37
lines changed

19 files changed

+253
-37
lines changed

de/guide/migrating-5.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
6666
<li><a href="#path-syntax">Path route matching syntax</a></li>
6767
<li><a href="#rejected-promises">Rejected promises handled from middleware and handlers</a></li>
6868
<li><a href="#express.urlencoded">express.urlencoded</a></li>
69+
<li><a href="#express.static.dotfiles">express.static dotfiles</a></li>
6970
<li><a href="#app.listen">app.listen</a></li>
7071
<li><a href="#app.router">app.router</a></li>
7172
<li><a href="#req.body">req.body</a></li>
@@ -469,6 +470,29 @@ Details of how Express handles errors is covered in the [error handling document
469470

470471
The `express.urlencoded` method makes the `extended` option `false` by default.
471472

473+
<h3 id="express.static.dotfiles">express.static dotfiles</h3>
474+
475+
In Express 5, the `express.static` middleware's `dotfiles` option now defaults to `"ignore"`. This is a change from Express 4, where dotfiles were served by default. As a result, files inside a directory that starts with a dot (`.`), such as `.well-known`, will no longer be accessible and will return a **404 Not Found** error. This can break functionality that depends on serving dot-directories, such as Android App Links, and Apple Universal Links.
476+
477+
Example of breaking code:
478+
479+
```js
480+
// v4
481+
app.use(express.static('public'))
482+
```
483+
484+
After migrating to Express 5, a request to `/.well-known/assetlinks.json` will result in a **404 Not Found**.
485+
486+
To fix this, serve specific dot-directories explicitly using the `dotfiles: "allow"` option:
487+
488+
```js
489+
// v5
490+
app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' }))
491+
app.use(express.static('public'))
492+
```
493+
494+
This approach allows you to safely serve only the intended dot-directories while keeping the default secure behavior for other dotfiles, which remain inaccessible.
495+
472496
<h3 id="app.listen">app.listen</h3>
473497

474498
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.

de/starter/basic-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ app.get('/', (req, res) => {
3939
})
4040
```
4141

42-
Antworten Sie auf POST-Anforderungen auf die Weiterleitung zum Stammverzeichnis (`/`), der Homepage der Anwendung:
42+
Respond to a POST request on the root route (`/`), the application's home page:
4343

4444
```js
4545
app.post('/', (req, res) => {
@@ -65,4 +65,4 @@ app.delete('/user', (req, res) => {
6565

6666
Details zum Thema Routing finden Sie in der entsprechenden [Routinganleitung](/{{ page.lang }}/guide/routing.html).
6767

68-
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)
68+
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)

es/guide/migrating-5.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
6666
<li><a href="#path-syntax">Path route matching syntax</a></li>
6767
<li><a href="#rejected-promises">Rejected promises handled from middleware and handlers</a></li>
6868
<li><a href="#express.urlencoded">express.urlencoded</a></li>
69+
<li><a href="#express.static.dotfiles">express.static dotfiles</a></li>
6970
<li><a href="#app.listen">app.listen</a></li>
7071
<li><a href="#app.router">app.router</a></li>
7172
<li><a href="#req.body">req.body</a></li>
@@ -469,6 +470,29 @@ Details of how Express handles errors is covered in the [error handling document
469470

470471
The `express.urlencoded` method makes the `extended` option `false` by default.
471472

473+
<h3 id="express.static.dotfiles">express.static dotfiles</h3>
474+
475+
In Express 5, the `express.static` middleware's `dotfiles` option now defaults to `"ignore"`. This is a change from Express 4, where dotfiles were served by default. As a result, files inside a directory that starts with a dot (`.`), such as `.well-known`, will no longer be accessible and will return a **404 Not Found** error. This can break functionality that depends on serving dot-directories, such as Android App Links, and Apple Universal Links.
476+
477+
Example of breaking code:
478+
479+
```js
480+
// v4
481+
app.use(express.static('public'))
482+
```
483+
484+
After migrating to Express 5, a request to `/.well-known/assetlinks.json` will result in a **404 Not Found**.
485+
486+
To fix this, serve specific dot-directories explicitly using the `dotfiles: "allow"` option:
487+
488+
```js
489+
// v5
490+
app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' }))
491+
app.use(express.static('public'))
492+
```
493+
494+
This approach allows you to safely serve only the intended dot-directories while keeping the default secure behavior for other dotfiles, which remain inaccessible.
495+
472496
<h3 id="app.listen">app.listen</h3>
473497

474498
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.

es/starter/basic-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ app.get('/', (req, res) => {
3939
})
4040
```
4141

42-
Responda a la solicitud POST en la ruta raíz (`/`), la página de inicio de la aplicación:
42+
Respond to a POST request on the root route (`/`), the application's home page:
4343

4444
```js
4545
app.post('/', (req, res) => {
@@ -65,4 +65,4 @@ app.delete('/user', (req, res) => {
6565

6666
Para obtener más detalles sobre el direccionamiento, consulte la [guía de direccionamiento](/{{ page.lang }}/guide/routing.html).
6767

68-
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)
68+
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)

fr/guide/migrating-5.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ nom pour app.param(name, fn)</a></li>
7575
<li><a href="#path-syntax">Path route matching syntax</a></li>
7676
<li><a href="#rejected-promises">Rejected promises handled from middleware and handlers</a></li>
7777
<li><a href="#express.urlencoded">express.urlencoded</a></li>
78+
<li><a href="#express.static.dotfiles">express.static dotfiles</a></li>
7879
<li><a href="#app.listen">app.listen</a></li>
7980
<li><a href="#app.router">app.router</a></li>
8081
<li><a href="#req.body">req.body</a></li>
@@ -523,6 +524,29 @@ Details of how Express handles errors is covered in the [error handling document
523524

524525
The `express.urlencoded` method makes the `extended` option `false` by default.
525526

527+
<h3 id="express.static.dotfiles">express.static dotfiles</h3>
528+
529+
In Express 5, the `express.static` middleware's `dotfiles` option now defaults to `"ignore"`. This is a change from Express 4, where dotfiles were served by default. As a result, files inside a directory that starts with a dot (`.`), such as `.well-known`, will no longer be accessible and will return a **404 Not Found** error. This can break functionality that depends on serving dot-directories, such as Android App Links, and Apple Universal Links.
530+
531+
Example of breaking code:
532+
533+
```js
534+
// v4
535+
app.use(express.static('public'))
536+
```
537+
538+
After migrating to Express 5, a request to `/.well-known/assetlinks.json` will result in a **404 Not Found**.
539+
540+
To fix this, serve specific dot-directories explicitly using the `dotfiles: "allow"` option:
541+
542+
```js
543+
// v5
544+
app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' }))
545+
app.use(express.static('public'))
546+
```
547+
548+
This approach allows you to safely serve only the intended dot-directories while keeping the default secure behavior for other dotfiles, which remain inaccessible.
549+
526550
<h3 id="app.listen">app.listen</h3>
527551

528552
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.

fr/starter/basic-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ app.get('/', (req, res) => {
4040
})
4141
```
4242

43-
Réponse à une demande POST sur la route racine (`/`), sur la page d'accueil de l'application :
43+
Respond to a POST request on the root route (`/`), the application's home page:
4444

4545
```js
4646
app.post('/', (req, res) => {
@@ -66,4 +66,4 @@ app.delete('/user', (req, res) => {
6666

6767
Pour plus de détails sur le routage, reportez-vous au [guide de routage](/{{ page.lang }}/guide/routing.html).
6868

69-
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)
69+
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)

it/guide/migrating-5.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
6666
<li><a href="#path-syntax">Path route matching syntax</a></li>
6767
<li><a href="#rejected-promises">Rejected promises handled from middleware and handlers</a></li>
6868
<li><a href="#express.urlencoded">express.urlencoded</a></li>
69+
<li><a href="#express.static.dotfiles">express.static dotfiles</a></li>
6970
<li><a href="#app.listen">app.listen</a></li>
7071
<li><a href="#app.router">app.router</a></li>
7172
<li><a href="#req.body">req.body</a></li>
@@ -469,6 +470,29 @@ Details of how Express handles errors is covered in the [error handling document
469470

470471
The `express.urlencoded` method makes the `extended` option `false` by default.
471472

473+
<h3 id="express.static.dotfiles">express.static dotfiles</h3>
474+
475+
In Express 5, the `express.static` middleware's `dotfiles` option now defaults to `"ignore"`. This is a change from Express 4, where dotfiles were served by default. As a result, files inside a directory that starts with a dot (`.`), such as `.well-known`, will no longer be accessible and will return a **404 Not Found** error. This can break functionality that depends on serving dot-directories, such as Android App Links, and Apple Universal Links.
476+
477+
Example of breaking code:
478+
479+
```js
480+
// v4
481+
app.use(express.static('public'))
482+
```
483+
484+
After migrating to Express 5, a request to `/.well-known/assetlinks.json` will result in a **404 Not Found**.
485+
486+
To fix this, serve specific dot-directories explicitly using the `dotfiles: "allow"` option:
487+
488+
```js
489+
// v5
490+
app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' }))
491+
app.use(express.static('public'))
492+
```
493+
494+
This approach allows you to safely serve only the intended dot-directories while keeping the default secure behavior for other dotfiles, which remain inaccessible.
495+
472496
<h3 id="app.listen">app.listen</h3>
473497

474498
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.

it/starter/basic-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ app.get('/', (req, res) => {
3939
})
4040
```
4141

42-
Rispondere alla richiesta POST sulla route principale (`/`), la home page dell'applicazione:
42+
Respond to a POST request on the root route (`/`), the application's home page:
4343

4444
```js
4545
app.post('/', (req, res) => {
@@ -65,4 +65,4 @@ app.delete('/user', (req, res) => {
6565

6666
Per ulteriori dettagli sul routing, consultare il [Manuale routing](/{{ page.lang }}/guide/routing.html).
6767

68-
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)
68+
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)

ja/guide/migrating-5.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
6666
<li><a href="#path-syntax">Path route matching syntax</a></li>
6767
<li><a href="#rejected-promises">Rejected promises handled from middleware and handlers</a></li>
6868
<li><a href="#express.urlencoded">express.urlencoded</a></li>
69+
<li><a href="#express.static.dotfiles">express.static dotfiles</a></li>
6970
<li><a href="#app.listen">app.listen</a></li>
7071
<li><a href="#app.router">app.router</a></li>
7172
<li><a href="#req.body">req.body</a></li>
@@ -469,6 +470,29 @@ Details of how Express handles errors is covered in the [error handling document
469470

470471
The `express.urlencoded` method makes the `extended` option `false` by default.
471472

473+
<h3 id="express.static.dotfiles">express.static dotfiles</h3>
474+
475+
In Express 5, the `express.static` middleware's `dotfiles` option now defaults to `"ignore"`. This is a change from Express 4, where dotfiles were served by default. As a result, files inside a directory that starts with a dot (`.`), such as `.well-known`, will no longer be accessible and will return a **404 Not Found** error. This can break functionality that depends on serving dot-directories, such as Android App Links, and Apple Universal Links.
476+
477+
Example of breaking code:
478+
479+
```js
480+
// v4
481+
app.use(express.static('public'))
482+
```
483+
484+
After migrating to Express 5, a request to `/.well-known/assetlinks.json` will result in a **404 Not Found**.
485+
486+
To fix this, serve specific dot-directories explicitly using the `dotfiles: "allow"` option:
487+
488+
```js
489+
// v5
490+
app.use('/.well-known', express.static('public/.well-known', { dotfiles: 'allow' }))
491+
app.use(express.static('public'))
492+
```
493+
494+
This approach allows you to safely serve only the intended dot-directories while keeping the default secure behavior for other dotfiles, which remain inaccessible.
495+
472496
<h3 id="app.listen">app.listen</h3>
473497

474498
In Express 5, the `app.listen` method will invoke the user-provided callback function (if provided) when the server receives an error event. In Express 4, such errors would be thrown. This change shifts error-handling responsibility to the callback function in Express 5. If there is an error, it will be passed to the callback as an argument.

ja/starter/basic-routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ app.get('/', (req, res) => {
4141
})
4242
```
4343

44-
アプリケーションのホーム・ページであるルートのルート (`/`) で POST 要求に応答します。
44+
Respond to a POST request on the root route (`/`), the application's home page:
4545

4646
```js
4747
app.post('/', (req, res) => {
@@ -67,4 +67,4 @@ app.delete('/user', (req, res) => {
6767

6868
ルーティングについて詳しくは、[ルーティング・ガイド](/{{ page.lang }}/guide/routing.html)を参照してください。
6969

70-
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)
70+
### [Previous: Express application generator ](/{{ page.lang }}/starter/generator.html)&nbsp;&nbsp;&nbsp;&nbsp;[Next: Serving static files in Express ](/{{ page.lang }}/starter/static-files.html)

0 commit comments

Comments
 (0)