diff --git a/content/components.md b/content/components.md
index 66deda14ab..f714d3d9d2 100644
--- a/content/components.md
+++ b/content/components.md
@@ -112,7 +112,7 @@ The `CatsService` is **injected** through the class constructor. Notice the use
#### Dependency injection
-Nest is built around the strong design pattern commonly known as **Dependency injection**. We recommend reading a great article about this concept in the official [Angular](https://angular.io/guide/dependency-injection) documentation.
+Nest is built around the strong design pattern commonly known as **Dependency injection**. We recommend reading a great article about this concept in the official [Angular](https://angular.dev/guide/di) documentation.
In Nest, thanks to TypeScript capabilities, it's extremely easy to manage dependencies because they are resolved just by type. In the example below, Nest will resolve the `catsService` by creating and returning an instance of `CatsService` (or, in the normal case of a singleton, returning the existing instance if it has already been requested elsewhere). This dependency is resolved and passed to your controller's constructor (or assigned to the indicated property):
diff --git a/content/devtools/ci-cd.md b/content/devtools/ci-cd.md
index adbe04f667..2df5b22a7c 100644
--- a/content/devtools/ci-cd.md
+++ b/content/devtools/ci-cd.md
@@ -83,9 +83,9 @@ See screenshot below:
The ability to go back in time lets you investigate and troubleshoot the issue by comparing the current graph with the previous one. Depending on how you set things up, every pull request (or even every commit) will have a corresponding snapshot in the registry, so you can easily go back in time and see what changed. Think of Devtools as a Git but with an understanding of how Nest constructs your application graph, and with the ability to **visualize** it.
-#### Integrations: Github Actions
+#### Integrations: GitHub Actions
-First let's start from creating a new Github workflow in the `.github/workflows` directory in our project and call it, for example, `publish-graph.yml`. Inside this file, let's use the following definition:
+First let's start from creating a new GitHub workflow in the `.github/workflows` directory in our project and call it, for example, `publish-graph.yml`. Inside this file, let's use the following definition:
```yaml
name: Devtools
@@ -130,7 +130,7 @@ jobs:
TARGET_SHA: {{ '${{' }} github.event.pull_request.base.sha {{ '}}' }}
```
-Ideally, `DEVTOOLS_API_KEY` environment variable should be retrieved from Github Secrets, read more [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) .
+Ideally, `DEVTOOLS_API_KEY` environment variable should be retrieved from GitHub Secrets, read more [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) .
This workflow will run per each pull request that's targeting the `master` branch OR in case there's a direct commit to the `master` branch. Feel free to align this configuration to whatever your project needs. What's essential here is that we provide necessary environment varaiables for our `GraphPublisher` class (to run).
@@ -150,7 +150,7 @@ const publishOptions = {
};
```
-For the best developer experience, make sure to integrate the **Github application** for your project by clicking on the "Integrate Github app" button (see screenshot below). Note - this isn't required.
+For the best developer experience, make sure to integrate the **GitHub application** for your project by clicking on the "Integrate GitHub app" button (see screenshot below). Note - this isn't required.
diff --git a/content/devtools/overview.md b/content/devtools/overview.md
index 4e0ffa68be..674f625ce2 100644
--- a/content/devtools/overview.md
+++ b/content/devtools/overview.md
@@ -112,7 +112,7 @@ Upon successful upload, you should see the following graph & dialog window:
-As you can see, the highlighted `TasksModule` is the one we should look into. Also, in the dialog window you can already see some instructions on how to use fix this issue.
+As you can see, the highlighted `TasksModule` is the one we should look into. Also, in the dialog window you can already see some instructions on how to fix this issue.
If we switch to the "Classes" view instead, that's what we'll see:
diff --git a/content/faq/request-lifecycle.md b/content/faq/request-lifecycle.md
index f8a1468385..23464f8ff4 100644
--- a/content/faq/request-lifecycle.md
+++ b/content/faq/request-lifecycle.md
@@ -26,7 +26,7 @@ export class CatsController {
`Guard1` will execute before `Guard2` and both will execute before `Guard3`.
-> info **Hint** When speaking about globally bound vs controller or locally bound, the difference is where the guard (or other component is bound). If you are using `app.useGlobalGuard()` or providing the component via a module, it is globally bound. Otherwise, it is bound to a controller if the decorator precedes a controller class, or to a route if the decorator proceeds a route declaration.
+> info **Hint** When speaking about globally bound vs controller or locally bound, the difference is where the guard (or other component is bound). If you are using `app.useGlobalGuard()` or providing the component via a module, it is globally bound. Otherwise, it is bound to a controller if the decorator precedes a controller class, or to a route if the decorator precedes a route declaration.
#### Interceptors
diff --git a/content/faq/serverless.md b/content/faq/serverless.md
index fae58a7cb7..b0be8df91b 100644
--- a/content/faq/serverless.md
+++ b/content/faq/serverless.md
@@ -209,7 +209,7 @@ functions:
> info **Hint** To learn more about the Serverless framework, visit the [official documentation](https://www.serverless.com/framework/docs/).
-With this place, we can now navigate to the `main.ts` file and update our bootstrap code with the required boilerplate:
+With this in place, we can now navigate to the `main.ts` file and update our bootstrap code with the required boilerplate:
```typescript
import { NestFactory } from '@nestjs/core';
diff --git a/content/fundamentals/lazy-loading-modules.md b/content/fundamentals/lazy-loading-modules.md
index 5a3e942d7a..9e3d242fae 100644
--- a/content/fundamentals/lazy-loading-modules.md
+++ b/content/fundamentals/lazy-loading-modules.md
@@ -4,7 +4,7 @@ By default, modules are eagerly loaded, which means that as soon as the applicat
Lazy loading can help decrease bootstrap time by loading only modules required by the specific serverless function invocation. In addition, you could also load other modules asynchronously once the serverless function is "warm" to speed-up the bootstrap time for subsequent calls even further (deferred modules registration).
-> info **Hint** If you're familiar with the **Angular** framework, you might have seen the "lazy-loading modules" term before. Be aware that this technique is **functionally different** in Nest and so think about this as an entirely different feature that shares similar naming conventions.
+> info **Hint** If you're familiar with the **[Angular](https://angular.dev/)** framework, you might have seen the "[lazy-loading modules](https://angular.dev/guide/ngmodules/lazy-loading#lazy-loading-basics)" term before. Be aware that this technique is **functionally different** in Nest and so think about this as an entirely different feature that shares similar naming conventions.
> warning **Warning** Do note that [lifecycle hooks methods](https://docs.nestjs.com/fundamentals/lifecycle-events) are not invoked in lazy loaded modules and services.
diff --git a/content/modules.md b/content/modules.md
index 83d8275ad5..8aa8682711 100644
--- a/content/modules.md
+++ b/content/modules.md
@@ -151,7 +151,7 @@ However, module classes themselves cannot be injected as providers due to [circu
#### Global modules
-If you have to import the same set of modules everywhere, it can get tedious. Unlike in Nest, [Angular](https://angular.io) `providers` are registered in the global scope. Once defined, they're available everywhere. Nest, however, encapsulates providers inside the module scope. You aren't able to use a module's providers elsewhere without first importing the encapsulating module.
+If you have to import the same set of modules everywhere, it can get tedious. Unlike in Nest, [Angular](https://angular.dev) `providers` are registered in the global scope. Once defined, they're available everywhere. Nest, however, encapsulates providers inside the module scope. You aren't able to use a module's providers elsewhere without first importing the encapsulating module.
When you want to provide a set of providers which should be available everywhere out-of-the-box (e.g., helpers, database connections, etc.), make the module **global** with the `@Global()` decorator.
diff --git a/content/security/authentication.md b/content/security/authentication.md
index f74de4bdbb..2c19d246dc 100644
--- a/content/security/authentication.md
+++ b/content/security/authentication.md
@@ -232,7 +232,10 @@ export class AuthService {
private jwtService: JwtService
) {}
- async signIn(username, pass) {
+ async signIn(
+ username: string,
+ pass: string,
+ ): Promise<{ access_token: string }> {
const user = await this.usersService.findOne(username);
if (user?.password !== pass) {
throw new UnauthorizedException();
diff --git a/content/techniques/cookies.md b/content/techniques/cookies.md
index 8d203c6e5a..759c0a378f 100644
--- a/content/techniques/cookies.md
+++ b/content/techniques/cookies.md
@@ -26,7 +26,7 @@ You can pass several options to the `cookieParser` middleware:
The middleware will parse the `Cookie` header on the request and expose the cookie data as the property `req.cookies` and, if a secret was provided, as the property `req.signedCookies`. These properties are name value pairs of the cookie name to cookie value.
-When secret is provided, this module will unsign and validate any signed cookie values and move those name value pairs from `req.cookies` into `req.signedCookies`. A signed cookie is a cookie that has a value prefixed with `s:`. Signed cookies that fail signature validation will have the value `false` instead of the tampered value.
+When a secret is provided, this module will unsign and validate any signed cookie values and move those name value pairs from `req.cookies` into `req.signedCookies`. A signed cookie is a cookie that has a value prefixed with `s:`. Signed cookies that fail signature validation will have the value `false` instead of the tampered value.
With this in place, you can now read cookies from within the route handlers, as follows:
@@ -67,10 +67,7 @@ Once the installation is complete, register the `@fastify/cookie` plugin:
import fastifyCookie from '@fastify/cookie';
// somewhere in your initialization file
-const app = await NestFactory.create(
- AppModule,
- new FastifyAdapter(),
-);
+const app = await NestFactory.create(AppModule, new FastifyAdapter());
await app.register(fastifyCookie, {
secret: 'my-secret', // for cookies signature
});
@@ -109,12 +106,10 @@ To provide a convenient, declarative way of accessing incoming cookies, we can c
```typescript
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
-export const Cookies = createParamDecorator(
- (data: string, ctx: ExecutionContext) => {
- const request = ctx.switchToHttp().getRequest();
- return data ? request.cookies?.[data] : request.cookies;
- },
-);
+export const Cookies = createParamDecorator((data: string, ctx: ExecutionContext) => {
+ const request = ctx.switchToHttp().getRequest();
+ return data ? request.cookies?.[data] : request.cookies;
+});
```
The `@Cookies()` decorator will extract all cookies, or a named cookie from the `req.cookies` object and populate the decorated parameter with that value.