Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions _data/fr/footer.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
terms_of_use: Terms of Use
privacy_policy: Privacy Policy
coc: Code of Conduct
trademark_policy: Trademark Policy
security_policy: Security Policy
license: License
terms_of_use: Conditions d’utilisation
privacy_policy: Politique de Confidentialité
coc: Code de Conduite
trademark_policy: Politique de Marque
security_policy: Politique de Sécurité
license: Licence
46 changes: 45 additions & 1 deletion de/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
<li><a href="#app.router">app.router</a></li>
<li><a href="#req.body">req.body</a></li>
<li><a href="#req.host">req.host</a></li>
<li><a href="#req.params">req.params</a></li>
<li><a href="#req.query">req.query</a></li>
<li><a href="#res.clearCookie">res.clearCookie</a></li>
<li><a href="#res.status">res.status</a></li>
Expand Down Expand Up @@ -512,14 +513,57 @@ const server = app.listen(8080, '0.0.0.0', (error) => {

Das Objekt `app.router`, das in Express 4 entfernt wurde, ist in Express 5 wieder verfügbar. In der neuen Version fungiert dieses Objekt nur als Referenz zum Express-Basisrouter – im Gegensatz zu Express 3, wo die Anwendung dieses Objekt explizit laden musste.

<h3 id="req.body">req.body</h3>
<h3 id="req.body">req.body</h3>

The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.

<h3 id="req.host">req.host</h3>

In Express 4 übergab die Funktion `req.host` nicht ordnungsgemäß eine eventuell vorhandene Portnummer. In Express 5 wird die Portnummer beibehalten.

<h3 id="req.params">req.params</h3>

The `req.params` object now has a **null prototype** when using string paths. However, if the path is defined with a regular expression, `req.params` remains a standard object with a normal prototype. Additionally, there are two important behavioral changes:

**Wildcard parameters are now arrays:**

Wildcards (e.g., `/*splat`) capture path segments as an array instead of a single string.

```js
app.get('/*splat', (req, res) => {
// GET /foo/bar
console.dir(req.params)
// => [Object: null prototype] { splat: [ 'foo', 'bar' ] }
})
```

**Unmatched parameters are omitted:**

In Express 4, unmatched wildcards were empty strings (`''`) and optional `:` parameters (using `?`) had a key with value `undefined`. In Express 5, unmatched parameters are completely omitted from `req.params`.

```js
// v4: unmatched wildcard is empty string
app.get('/*', (req, res) => {
// GET /
console.dir(req.params)
// => { '0': '' }
})

// v4: unmatched optional param is undefined
app.get('/:file.:ext?', (req, res) => {
// GET /image
console.dir(req.params)
// => { file: 'image', ext: undefined }
})

// v5: unmatched optional param is omitted
app.get('/:file{.:ext}', (req, res) => {
// GET /image
console.dir(req.params)
// => [Object: null prototype] { file: 'image' }
})
```

<h3 id="req.query">req.query</h3>

The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
Expand Down
46 changes: 45 additions & 1 deletion es/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
<li><a href="#app.router">app.router</a></li>
<li><a href="#req.body">req.body</a></li>
<li><a href="#req.host">req.host</a></li>
<li><a href="#req.params">req.params</a></li>
<li><a href="#req.query">req.query</a></li>
<li><a href="#res.clearCookie">res.clearCookie</a></li>
<li><a href="#res.status">res.status</a></li>
Expand Down Expand Up @@ -512,14 +513,57 @@ const server = app.listen(8080, '0.0.0.0', (error) => {

El objeto `app.router`, que se ha eliminado en Express 4, ha vuelto en Express 5. En la nueva versión, este objeto es sólo una referencia al direccionador de Express base, a diferencia de en Express 3, donde una aplicación debía cargarlo explícitamente.

<h3 id="req.body">req.body</h3>
<h3 id="req.body">req.body</h3>

The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.

<h3 id="req.host">req.host</h3>

En Express 4, la función `req.host` fragmentaba incorrectamente el número de puerto si estaba presente. In Express 5, the port number is maintained.

<h3 id="req.params">req.params</h3>

The `req.params` object now has a **null prototype** when using string paths. However, if the path is defined with a regular expression, `req.params` remains a standard object with a normal prototype. Additionally, there are two important behavioral changes:

**Wildcard parameters are now arrays:**

Wildcards (e.g., `/*splat`) capture path segments as an array instead of a single string.

```js
app.get('/*splat', (req, res) => {
// GET /foo/bar
console.dir(req.params)
// => [Object: null prototype] { splat: [ 'foo', 'bar' ] }
})
```

**Unmatched parameters are omitted:**

In Express 4, unmatched wildcards were empty strings (`''`) and optional `:` parameters (using `?`) had a key with value `undefined`. In Express 5, unmatched parameters are completely omitted from `req.params`.

```js
// v4: unmatched wildcard is empty string
app.get('/*', (req, res) => {
// GET /
console.dir(req.params)
// => { '0': '' }
})

// v4: unmatched optional param is undefined
app.get('/:file.:ext?', (req, res) => {
// GET /image
console.dir(req.params)
// => { file: 'image', ext: undefined }
})

// v5: unmatched optional param is omitted
app.get('/:file{.:ext}', (req, res) => {
// GET /image
console.dir(req.params)
// => [Object: null prototype] { file: 'image' }
})
```

<h3 id="req.query">req.query</h3>

The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
Expand Down
46 changes: 45 additions & 1 deletion fr/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ nom pour app.param(name, fn)</a></li>
<li><a href="#app.router">app.router</a></li>
<li><a href="#req.body">req.body</a></li>
<li><a href="#req.host">req.host</a></li>
<li><a href="#req.params">req.params</a></li>
<li><a href="#req.query">req.query</a></li>
<li><a href="#res.clearCookie">res.clearCookie</a></li>
<li><a href="#res.status">res.status</a></li>
Expand Down Expand Up @@ -567,7 +568,7 @@ const server = app.listen(8080, '0.0.0.0', (error) => {
L'objet `app.router`, qui a été supprimé dans Express 4, est revenu dans Express 5. Dans la version, cet objet
n'est qu'une référence dans le routeur Express de base, contrairement à Express 3, où une application devait le charger explicitement.

<h3 id="req.body">req.body</h3>
<h3 id="req.body">req.body</h3>

The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.

Expand All @@ -576,6 +577,49 @@ The `req.body` property returns `undefined` when the body has not been parsed. I
Dans Express 4, la `req.host` retirait de
manière incorrecte le numéro de port s'il était présent. Dans Express 5, ce numéro de port est conservé.

<h3 id="req.params">req.params</h3>

The `req.params` object now has a **null prototype** when using string paths. However, if the path is defined with a regular expression, `req.params` remains a standard object with a normal prototype. Additionally, there are two important behavioral changes:

**Wildcard parameters are now arrays:**

Wildcards (e.g., `/*splat`) capture path segments as an array instead of a single string.

```js
app.get('/*splat', (req, res) => {
// GET /foo/bar
console.dir(req.params)
// => [Object: null prototype] { splat: [ 'foo', 'bar' ] }
})
```

**Unmatched parameters are omitted:**

In Express 4, unmatched wildcards were empty strings (`''`) and optional `:` parameters (using `?`) had a key with value `undefined`. In Express 5, unmatched parameters are completely omitted from `req.params`.

```js
// v4: unmatched wildcard is empty string
app.get('/*', (req, res) => {
// GET /
console.dir(req.params)
// => { '0': '' }
})

// v4: unmatched optional param is undefined
app.get('/:file.:ext?', (req, res) => {
// GET /image
console.dir(req.params)
// => { file: 'image', ext: undefined }
})

// v5: unmatched optional param is omitted
app.get('/:file{.:ext}', (req, res) => {
// GET /image
console.dir(req.params)
// => [Object: null prototype] { file: 'image' }
})
```

<h3 id="req.query">req.query</h3>

The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
Expand Down
2 changes: 1 addition & 1 deletion fr/guide/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _Routage_ fait référence à la définition de points finaux d'application (URI
Pour une introduction au routage, voir [Basic routing](/{{ page.lang }}/starter/basic-routing.html).

Vous définissez le routage à l’aide des méthodes de l’objet app d’Express correspondant aux méthodes HTTP :
par exemple, `app.get()` pour les requêtes GET et \`app.post pour les requêtes POST. Pour la liste complète,
par exemple, `app.get()` pour les requêtes GET et `app.post` pour les requêtes POST. Pour la liste complète,
voir [app.METHOD](/{{ page.lang }}/5x/api.html#app.METHOD). Vous pouvez également utiliser [app.all()](/{{ page.lang }}/5x/api.html#app.all) pour gérer toutes les méthodes HTTP et [app.use()](/{{ page.lang }}/5x/api.html#app.use) spécifier le middleware comme fonction de rappel (Voir [Utilisation du middleware](/{{ page.lang }}/guide/using-middleware.html) pour plus de détails).

Ces méthodes de routage spécifient une fonction de rappel (parfois "appelée fonction de gestion") qui est appelée lorsque l'application reçoit une requête correspondant à la route (point de terminaison) et à la méthode HTTP spécifiées. Autrement dit, l'application "écoute" les requêtes qui correspondent à la ou aux routes et à la ou aux méthodes spécifiées, et lorsqu'une correspondance est détectée, elle appelle la fonction de rappel définie.
Expand Down
46 changes: 45 additions & 1 deletion it/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
<li><a href="#app.router">app.router</a></li>
<li><a href="#req.body">req.body</a></li>
<li><a href="#req.host">req.host</a></li>
<li><a href="#req.params">req.params</a></li>
<li><a href="#req.query">req.query</a></li>
<li><a href="#res.clearCookie">res.clearCookie</a></li>
<li><a href="#res.status">res.status</a></li>
Expand Down Expand Up @@ -512,14 +513,57 @@ const server = app.listen(8080, '0.0.0.0', (error) => {

L'oggetto `app.router`, che era stato rimosso in Express 4, è ritornato in Express 5. Nella nuova versione, questo oggetto è solo un riferimento al router Express di base, diversamente da Express 3, in cui un'applicazione aveva il compito esplicito di caricarlo.

<h3 id="req.body">req.body</h3>
<h3 id="req.body">req.body</h3>

The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.

<h3 id="req.host">req.host</h3>

In Express 4, la funzione `req.host` andava a rimuovere in modo non corretto il numero porta nel caso fosse stato presente. In Express 5 il numero porta viene conservato.

<h3 id="req.params">req.params</h3>

The `req.params` object now has a **null prototype** when using string paths. However, if the path is defined with a regular expression, `req.params` remains a standard object with a normal prototype. Additionally, there are two important behavioral changes:

**Wildcard parameters are now arrays:**

Wildcards (e.g., `/*splat`) capture path segments as an array instead of a single string.

```js
app.get('/*splat', (req, res) => {
// GET /foo/bar
console.dir(req.params)
// => [Object: null prototype] { splat: [ 'foo', 'bar' ] }
})
```

**Unmatched parameters are omitted:**

In Express 4, unmatched wildcards were empty strings (`''`) and optional `:` parameters (using `?`) had a key with value `undefined`. In Express 5, unmatched parameters are completely omitted from `req.params`.

```js
// v4: unmatched wildcard is empty string
app.get('/*', (req, res) => {
// GET /
console.dir(req.params)
// => { '0': '' }
})

// v4: unmatched optional param is undefined
app.get('/:file.:ext?', (req, res) => {
// GET /image
console.dir(req.params)
// => { file: 'image', ext: undefined }
})

// v5: unmatched optional param is omitted
app.get('/:file{.:ext}', (req, res) => {
// GET /image
console.dir(req.params)
// => [Object: null prototype] { file: 'image' }
})
```

<h3 id="req.query">req.query</h3>

The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
Expand Down
46 changes: 45 additions & 1 deletion ja/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ You can find the list of available codemods [here](https://github.com/expressjs/
<li><a href="#app.router">app.router</a></li>
<li><a href="#req.body">req.body</a></li>
<li><a href="#req.host">req.host</a></li>
<li><a href="#req.params">req.params</a></li>
<li><a href="#req.query">req.query</a></li>
<li><a href="#res.clearCookie">res.clearCookie</a></li>
<li><a href="#res.status">res.status</a></li>
Expand Down Expand Up @@ -512,14 +513,57 @@ const server = app.listen(8080, '0.0.0.0', (error) => {

`app.router` オブジェクトは、Express 4 で削除されましたが、Express 5 で復帰しました。アプリケーションが明示的にロードする必要があった Express 3 とは異なり、新しいバージョンでは、このオブジェクトは基本の Express ルーターの単なる参照です。 In the new version, this object is a just a reference to the base Express router, unlike in Express 3, where an app had to explicitly load it.

<h3 id="req.body">req.body</h3>
<h3 id="req.body">req.body</h3>

The `req.body` property returns `undefined` when the body has not been parsed. In Express 4, it returns `{}` by default.

<h3 id="req.host">req.host</h3>

Express 4 では、`req.host` 関数は、ポート番号が存在する場合に、ポート番号を誤って削除していました。Express 5 では、ポート番号は維持されます。 In Express 5, the port number is maintained.

<h3 id="req.params">req.params</h3>

The `req.params` object now has a **null prototype** when using string paths. However, if the path is defined with a regular expression, `req.params` remains a standard object with a normal prototype. Additionally, there are two important behavioral changes:

**Wildcard parameters are now arrays:**

Wildcards (e.g., `/*splat`) capture path segments as an array instead of a single string.

```js
app.get('/*splat', (req, res) => {
// GET /foo/bar
console.dir(req.params)
// => [Object: null prototype] { splat: [ 'foo', 'bar' ] }
})
```

**Unmatched parameters are omitted:**

In Express 4, unmatched wildcards were empty strings (`''`) and optional `:` parameters (using `?`) had a key with value `undefined`. In Express 5, unmatched parameters are completely omitted from `req.params`.

```js
// v4: unmatched wildcard is empty string
app.get('/*', (req, res) => {
// GET /
console.dir(req.params)
// => { '0': '' }
})

// v4: unmatched optional param is undefined
app.get('/:file.:ext?', (req, res) => {
// GET /image
console.dir(req.params)
// => { file: 'image', ext: undefined }
})

// v5: unmatched optional param is omitted
app.get('/:file{.:ext}', (req, res) => {
// GET /image
console.dir(req.params)
// => [Object: null prototype] { file: 'image' }
})
```

<h3 id="req.query">req.query</h3>

The `req.query` property is no longer a writable property and is instead a getter. The default query parser has been changed from "extended" to "simple".
Expand Down
Loading