Skip to content

Commit

Permalink
docs(fastify): Document @RouteConstraints
Browse files Browse the repository at this point in the history
Document `@RouteConstraints` feature introduced in: https://github.com/nestjs/nest/releases/tag/v10.3.0
  • Loading branch information
Fcmam5 committed Dec 18, 2023
1 parent 836cd84 commit 28e39fc
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 28e39fc

Please sign in to comment.