You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Path route matching syntax is when a string is supplied as the first parameter to the `app.all()`, `app.use()`, `app.METHOD()`, `router.all()`, `router.METHOD()`, and `router.use()` APIs. The following changes have been made to how the path string is matched to an incoming request:
119
+
120
+
- Add new `?`, `*`, and `+` parameter modifiers.
121
+
- Matching group expressions are only RegExp syntax.
122
+
*`(*)` is no longer valid and must be written as `(.*)`, for example.
123
+
- Named matching groups no longer available by position in `req.params`.
124
+
*`/:foo(.*)` only captures as `req.params.foo` and not available as `req.params[0]`.
125
+
- Regular expressions can only be used in a matching group.
126
+
*`/\\d+` is no longer valid and must be written as `/(\\d+)`.
127
+
- Special `*` path segment behavior removed.
128
+
*`/foo/*/bar` will match a literal `*` as the middle segment.
129
+
115
130
<h4id="app.router">app.router</h4>
116
131
117
132
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.
0 commit comments