Skip to content

Commit fbc947d

Browse files
Merge pull request #2926 from Fcmam5/patch-1
docs(fastify): Document `@RouteConstraints`
2 parents 836cd84 + 28e39fc commit fbc947d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

content/techniques/performance.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,19 @@ index(@Req() req) {
115115
}
116116
```
117117

118-
> info **Hint** `@RouteConfig()` is imported from `@nestjs/platform-fastify`.
118+
#### Route Constraints
119+
120+
As of v10.3.0, `@nestjs/platform-fastify` supports [route constraints](https://fastify.dev/docs/latest/Reference/Routes/#constraints) feature of Fastify with `@RouteConstraints` decorator.
121+
122+
```typescript
123+
@RouteConstraints({ version: '1.2.x' })
124+
newFeature() {
125+
return 'This works only for version >= 1.2.x';
126+
}
127+
```
128+
129+
> info **Hint** `@RouteConfig()` and `@RouteConstraints` are imported from `@nestjs/platform-fastify`.
130+
119131

120132
#### Example
121133

0 commit comments

Comments
 (0)