Skip to content

Commit 89be2b9

Browse files
Merge pull request #2348 from nestjs/revert-2296-docs/renamed-fastify-plugins
Revert "docs(techniques): renamed fastify plugins"
2 parents ddc99f1 + 7ed0d8e commit 89be2b9

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

content/openapi/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ To begin using it, we first install the required dependencies.
1010
$ npm install --save @nestjs/swagger swagger-ui-express
1111
```
1212

13-
If you use fastify, install `@fastify/swagger` instead of `swagger-ui-express`:
13+
If you use fastify, install `fastify-swagger` instead of `swagger-ui-express`:
1414

1515
```bash
16-
$ npm install --save @nestjs/swagger @fastify/swagger
16+
$ npm install --save @nestjs/swagger fastify-swagger
1717
```
1818

1919
#### Bootstrap

content/security/helmet.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ app.use(helmet());
2424
2525
#### Use with Fastify
2626

27-
If you are using the `FastifyAdapter`, install the [@fastify/helmet](https://github.com/fastify/fastify-helmet) package:
27+
If you are using the `FastifyAdapter`, install the [fastify-helmet](https://github.com/fastify/fastify-helmet) package:
2828

2929
```bash
30-
$ npm i --save @fastify/helmet
30+
$ npm i --save fastify-helmet
3131
```
3232

3333
[fastify-helmet](https://github.com/fastify/fastify-helmet) should not be used as a middleware, but as a [Fastify plugin](https://www.fastify.io/docs/latest/Reference/Plugins/), i.e., by using `app.register()`:
3434

3535
```typescript
36-
import { fastifyHelmet } from '@fastify/helmet';
36+
import { fastifyHelmet } from 'fastify-helmet';
3737
// somewhere in your initialization file
3838
await app.register(fastifyHelmet);
3939
```
4040

41-
> warning **Warning** When using `apollo-server-fastify` and `@fastify/helmet`, there may be a problem with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) on the GraphQL playground, to solve this collision, configure the CSP as shown below:
41+
> warning **Warning** When using `apollo-server-fastify` and `fastify-helmet`, there may be a problem with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) on the GraphQL playground, to solve this collision, configure the CSP as shown below:
4242
>
4343
> ```typescript
4444
> await app.register(fastifyHelmet, {

content/techniques/compression.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ app.use(compression());
2727
If using the `FastifyAdapter`, you'll want to use [fastify-compress](https://github.com/fastify/fastify-compress):
2828

2929
```bash
30-
$ npm i --save @fastify/compress
30+
$ npm i --save fastify-compress
3131
```
3232

3333
Once the installation is complete, apply the fastify-compress middleware as global middleware.
3434

3535
```typescript
36-
import compression from '@fastify/compress';
36+
import compression from 'fastify-compress';
3737
// somewhere in your initialization file
3838
await app.register(compression);
3939
```
@@ -46,4 +46,4 @@ To specify encodings, provide a second argument to `app.register`:
4646
await app.register(compression, { encodings: ['gzip', 'deflate'] });
4747
```
4848

49-
The above tells `@fastify/compress` to only use gzip and deflate encodings, preferring gzip if the client supports both.
49+
The above tells `fastify-compress` to only use gzip and deflate encodings, preferring gzip if the client supports both.

content/techniques/cookies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ findAll(@Res({ passthrough: true }) response: Response) {
5858
First install the required package:
5959

6060
```shell
61-
$ npm i @fastify/cookie
61+
$ npm i fastify-cookie
6262
```
6363

64-
Once the installation is complete, register the `@fastify/cookie` plugin:
64+
Once the installation is complete, register the `fastify-cookie` plugin:
6565

6666
```typescript
67-
import fastifyCookie from '@fastify/cookie';
67+
import fastifyCookie from 'fastify-cookie';
6868

6969
// somewhere in your initialization file
7070
const app = await NestFactory.create<NestFastifyApplication>(

content/techniques/mvc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ A working example is available [here](https://github.com/nestjs/nest/tree/master
129129
As mentioned in this [chapter](/techniques/performance), we are able to use any compatible HTTP provider together with Nest. One such library is [Fastify](https://github.com/fastify/fastify). In order to create an MVC application with Fastify, we have to install the following packages:
130130

131131
```bash
132-
$ npm i --save @fastify/static point-of-view handlebars
132+
$ npm i --save fastify-static point-of-view handlebars
133133
```
134134

135135
The next steps cover almost the same process used with Express, with minor differences specific to the platform. Once the installation process is complete, open the `main.ts` file and update its contents:

0 commit comments

Comments
 (0)