Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nestjs/docs.nestjs.com
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 92e67f0996b2c05c345c6c98b1ee1b3e55593c95
Choose a base ref
..
head repository: nestjs/docs.nestjs.com
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4bb455212ba205f8cabff0a139a5b61dbae5b26a
Choose a head ref
Showing with 19 additions and 15 deletions.
  1. +2 −0 content/controllers.md
  2. +2 −0 content/middlewares.md
  3. +2 −2 content/migration.md
  4. +2 −2 content/recipes/swc.md
  5. +11 −11 package.json
2 changes: 2 additions & 0 deletions content/controllers.md
Original file line number Diff line number Diff line change
@@ -202,6 +202,8 @@ findAll() {

The `'abcd/*'` route path will match `abcd/`, `abcd/123`, `abcd/abc`, and so on. The hyphen ( `-`) and the dot (`.`) are interpreted literally by string-based paths.

This approach works on both Express and Fastify. However, with the latest release of Express (v5), the routing system has become more strict. In pure Express, you must use a named wildcard to make the route work—for example, `abcd/*splat`, where `splat` is simply the name of the wildcard parameter and has no special meaning. You can name it anything you like. That said, since Nest provides a compatibility layer for Express, you can still use the asterisk (`*`) as a wildcard.

When it comes to asterisks used in the **middle of a route**, Express requires named wildcards (e.g., `ab{{ '{' }}*splat}cd`), while Fastify does not support them at all.

#### Status code
2 changes: 2 additions & 0 deletions content/middlewares.md
Original file line number Diff line number Diff line change
@@ -137,6 +137,8 @@ forRoutes({
});
```

> info **Hint** `splat` is simply the name of the wildcard parameter and has no special meaning. You can name it anything you like, for example, `*wildcard`.
The `'abcd/*'` route path will match `abcd/1`, `abcd/123`, `abcd/abc`, and so on. The hyphen ( `-`) and the dot (`.`) are interpreted literally by string-based paths. However, `abcd/` with no additional characters will not match the route. For this, you need to wrap the wildcard in braces to make it optional:

```typescript
4 changes: 2 additions & 2 deletions content/migration.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ After years of development, Express v5 was officially released in 2024 and becam

One of the most notable updates in Express v5 is the revised path route matching algorithm. The following changes have been introduced to how path strings are matched with incoming requests:

- The wildcard `*` must have a name, matching the behavior of parameters :, use `/*splat` or `/{{ '{' }}*splat}` instead of `/*`
- The wildcard `*` must have a name, matching the behavior of parameters: use `/*splat` or `/{{ '{' }}*splat}` instead of `/*`. `splat` is simply the name of the wildcard parameter and has no special meaning. You can name it anything you like, for example, `*wildcard`
- The optional character `?` is no longer supported, use braces instead: `/:file{{ '{' }}.:ext}`.
- Regexp characters are not supported.
- Some characters have been reserved to avoid confusion during upgrade `(()[]?+!)`, use `\` to escape them.
@@ -38,7 +38,7 @@ findAll() {
}
```

> warning **Warning** Note that `*splat` is a named wildcard that matches any path without the root path. If you need to match the root path as well (`/users`), you can use `/users/{{ '{' }}*splat}`, wrapping the wildcard in braces (optional group).
> warning **Warning** Note that `*splat` is a named wildcard that matches any path without the root path. If you need to match the root path as well (`/users`), you can use `/users/{{ '{' }}*splat}`, wrapping the wildcard in braces (optional group). Note that `splat` is simply the name of the wildcard parameter and has no special meaning. You can name it anything you like, for example, `*wildcard`.
Similarly, if you have a middleware that runs on all routes, you may need to update the path to use a named wildcard:

4 changes: 2 additions & 2 deletions content/recipes/swc.md
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ SWC builder is pre-configured to match the requirements of NestJS applications.

```json
{
"$schema": "https://json.schemastore.org/swcrc",
"$schema": "https://swc.rs/schema.json",
"sourceMaps": true,
"jsc": {
"parser": {
@@ -228,7 +228,7 @@ Additionally you would need to add the following `transform` properties to your

```json
{
"$schema": "https://json.schemastore.org/swcrc",
"$schema": "https://swc.rs/schema.json",
"sourceMaps": true,
"jsc": {
"parser": {
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -24,17 +24,17 @@
},
"private": true,
"dependencies": {
"@angular/animations": "19.1.2",
"@angular/animations": "19.1.3",
"@angular/cdk": "18.2.9",
"@angular/common": "19.1.2",
"@angular/compiler": "19.1.2",
"@angular/core": "19.1.2",
"@angular/forms": "19.1.2",
"@angular/common": "19.1.3",
"@angular/compiler": "19.1.3",
"@angular/core": "19.1.3",
"@angular/forms": "19.1.3",
"@angular/material": "18.2.9",
"@angular/platform-browser": "19.1.2",
"@angular/platform-browser-dynamic": "19.1.2",
"@angular/router": "19.1.2",
"@angular/service-worker": "19.1.2",
"@angular/platform-browser": "19.1.3",
"@angular/platform-browser-dynamic": "19.1.3",
"@angular/router": "19.1.3",
"@angular/service-worker": "19.1.3",
"core-js": "3.31.0",
"hammerjs": "2.0.8",
"nodemon": "3.1.7",
@@ -48,8 +48,8 @@
"@angular-devkit/build-angular": "18.2.9",
"@angular-eslint/eslint-plugin": "19.0.0",
"@angular/cli": "18.2.9",
"@angular/compiler-cli": "19.1.2",
"@angular/language-service": "19.1.2",
"@angular/compiler-cli": "19.1.3",
"@angular/language-service": "19.1.3",
"@commitlint/cli": "19.5.0",
"@commitlint/config-angular": "19.5.0",
"@eslint/js": "9.12.0",