Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Remove references to Express v3
  • Loading branch information
euoia committed Jan 5, 2022
commit 0b1e71235c4954753a1da2ff0debad856f1ffac9
4 changes: 2 additions & 2 deletions en/guide/migrating-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ The `res.sendfile()` function has been replaced by a camel-cased version `res.se

<h4 id="app.router">app.router</h4>

The `app.router` object, which was removed in Express 4, has made a comeback in Express 5. 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.
The `app.router` object, which was removed in Express 4, has made a comeback in Express 5.

The new version of the router contains **breaking changes** to the way paths are parsed due to an update in [paths-to-regexp from 0.1.7 to 6.2.0](https://github.com/pillarjs/path-to-regexp):
The Express v5 [router](https://github.com/pillarjs/router) contains **breaking changes** to the way paths are parsed due to an update in [paths-to-regexp from 0.1.7 to 6.2.0](https://github.com/pillarjs/path-to-regexp):

1. New `?`, `*`, and `+` parameter modifiers have been added. For example `/users/:user+` now matches `/users/1`, `/users/1/2`, etc. but not `/users`.
2. The special `*` path segment behavior has been removed. This means that `*` is no longer a valid path and `/foo/*/bar` now matches a literal `'*'`. For the previous behaviour, a `(.*)` matching group should be used instead.
Expand Down