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
Copy file name to clipboardExpand all lines: content/faq/global-prefix.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,4 +21,4 @@ Alternatively, you can specify route as a string (it will apply to every request
21
21
app.setGlobalPrefix('v1', { exclude: ['cats'] });
22
22
```
23
23
24
-
> info **Hint** The `path` property supports wildcard parameters using the [path-to-regexp](https://github.com/pillarjs/path-to-regexp#parameters) package. Note: this does not accept wildcard asterisks `*`. Instead, you must use parameters (e.g., `(.*)`, `:splat*`).
24
+
> info **Hint** The `path` property supports wildcard parameters using the [path-to-regexp](https://github.com/pillarjs/path-to-regexp#parameters) package. Note: this does not accept wildcard asterisks `*`. Instead, you must use parameters (`:param`) or named wildcards (`*splat`).
Copy file name to clipboardExpand all lines: content/migration.md
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,26 @@ bootstrap();
88
88
89
89
`@nestjs/platform-fastify` v11 now finally supports Fastify v5. This update should be seamless for most users; however, Fastify v5 introduces a few breaking changes, though these are unlikely to affect the majority of NestJS users. For more detailed information, refer to the [Fastify v5 migration guide](https://fastify.dev/docs/v5.1.x/Guides/Migration-Guide-V5/).
90
90
91
-
> info **Hint** There have been no changes to path matching in Fastify v5, so you can continue using the wildcard syntax as you did before. The behavior remains the same, and routes defined with wildcards (like `*`) will still work as expected.
91
+
> info **Hint** There have been no changes to path matching in Fastify v5 (except for middleware, see the section below), so you can continue using the wildcard syntax as you did before. The behavior remains the same, and routes defined with wildcards (like `*`) will still work as expected.
92
+
93
+
#### Fastify middleware registration
94
+
95
+
NestJS 11 now uses the latest version of the [path-to-regexp](https://www.npmjs.com/package/path-to-regexp) package to match **middleware paths** in `@nestjs/platform-fastify`. As a result, the `(.*)` syntax for matching all paths is no longer supported. Instead, you should use named wildcards.
96
+
97
+
For example, if you have a middleware that applies to all routes:
98
+
99
+
```typescript
100
+
// In NestJS 11, this will automatically be converted to a valid route, even if you don't update it.
101
+
.forRoutes('(.*)');
102
+
```
103
+
104
+
You'll need to update it to use a named wildcard instead:
105
+
106
+
```typescript
107
+
.forRoutes('*splat');
108
+
```
109
+
110
+
Where `splat` is just an arbitrary name for the wildcard parameter. You can name it anything you like.
92
111
93
112
#### Module resolution algorithm
94
113
@@ -290,9 +309,11 @@ Key changes:
290
309
291
310
> info **Info** Please note that the `HealthIndicator` and `HealthCheckError` classes have been marked as deprecated and are scheduled for removal in the next major release.
292
311
293
-
#### Node.js v16 no longer supported
312
+
#### Node.js v16 and v18 no longer supported
313
+
314
+
Starting with NestJS 11, Node.js v16 is no longer supported, as it reached its end-of-life (EOL) on September 11, 2023. Likewise, the security support is scheduled to end on April 30, 2025 for Node.js v18, so we went ahead and dropped support for it as well.
294
315
295
-
Starting with NestJS 11, Node.js v16 is no longer supported, as it reached its end-of-life (EOL) on September 11, 2023. NestJS 11 now requires **Node.js v20 or higher**.
316
+
NestJS 11 now requires **Node.js v20 or higher**.
296
317
297
318
To ensure the best experience, we strongly recommend using the latest LTS version of Node.js.
0 commit comments