Skip to content

Commit

Permalink
Merge pull request nestjs#2926 from Fcmam5/patch-1
Browse files Browse the repository at this point in the history
docs(fastify): Document `@RouteConstraints`
  • Loading branch information
kamilmysliwiec authored Dec 20, 2023
2 parents 836cd84 + 28e39fc commit fbc947d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion content/techniques/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,19 @@ index(@Req() req) {
}
```

> info **Hint** `@RouteConfig()` is imported from `@nestjs/platform-fastify`.
#### Route Constraints

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.

```typescript
@RouteConstraints({ version: '1.2.x' })
newFeature() {
return 'This works only for version >= 1.2.x';
}
```

> info **Hint** `@RouteConfig()` and `@RouteConstraints` are imported from `@nestjs/platform-fastify`.

#### Example

Expand Down

0 comments on commit fbc947d

Please sign in to comment.