Skip to content

Commit ac5d7dc

Browse files
chore: merge to master
2 parents 5f68f37 + 94f8cd4 commit ac5d7dc

33 files changed

+391
-105
lines changed

content/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Providers are a fundamental concept in Nest. Many of the basic Nest classes may be treated as a provider – services, repositories, factories, helpers, and so on. The main idea of a provider is that it can be **injected** as a dependency; this means objects can create various relationships with each other, and the function of "wiring up" these objects can largely be delegated to the Nest runtime system.
44

5-
<figure><img src="/assets/Components_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Components_1.png" /></figure>
66

77
In the previous chapter, we built a simple `CatsController`. Controllers should handle HTTP requests and delegate more complex tasks to **providers**. Providers are plain JavaScript classes that are declared as `providers` in a [module](/modules).
88

content/controllers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Controllers are responsible for handling incoming **requests** and returning **responses** to the client.
44

5-
<figure><img src="/assets/Controllers_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Controllers_1.png" /></figure>
66

77
A controller's purpose is to receive specific requests for the application. The **routing** mechanism controls which controller receives which requests. Frequently, each controller has more than one route, and different routes can perform different actions.
88

content/exception-filters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Nest comes with a built-in **exceptions layer** which is responsible for processing all unhandled exceptions across an application. When an exception is not handled by your application code, it is caught by this layer, which then automatically sends an appropriate user-friendly response.
44

55
<figure>
6-
<img src="/assets/Filter_1.png" />
6+
<img class="illustrative-image" src="/assets/Filter_1.png" />
77
</figure>
88

99
Out of the box, this action is performed by a built-in **global exception filter**, which handles exceptions of type `HttpException` (and subclasses of it). When an exception is **unrecognized** (is neither `HttpException` nor a class that inherits from `HttpException`), the built-in exception filter generates the following default JSON response:

content/first-steps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In this set of articles, you'll learn the **core fundamentals** of Nest. To get
44

55
#### Language
66

7-
We're in love with [TypeScript](https://www.typescriptlang.org/), but above all - we love [Node.js](https://nodejs.org/en/). That's why Nest is compatible with both TypeScript and **pure JavaScript**. Nest takes advantage of the latest language features, so to use it with vanilla JavaScript we need a [Babel](https://babeljs.io/) compiler.
7+
We're in love with [TypeScript](https://www.typescriptlang.org/), but above all - we love [Node.js](https://nodejs.org/en/). That's why Nest is compatible with both TypeScript and pure JavaScript. Nest takes advantage of the latest language features, so to use it with vanilla JavaScript we need a [Babel](https://babeljs.io/) compiler.
88

99
We'll mostly use TypeScript in the examples we provide, but you can always **switch the code snippets** to vanilla JavaScript syntax (simply click to toggle the language button in the upper right hand corner of each snippet).
1010

content/fundamentals/lifecycle-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A Nest application, as well as every application element, has a lifecycle manage
66

77
The following diagram depicts the sequence of key application lifecycle events, from the time the application is bootstrapped until the node process exits. We can divide the overall lifecycle into three phases: **initializing**, **running** and **terminating**. Using this lifecycle, you can plan for appropriate initialization of modules and services, manage active connections, and gracefully shutdown your application when it receives a termination signal.
88

9-
<figure><img src="/assets/lifecycle-events.png" /></figure>
9+
<figure><img class="illustrative-image" src="/assets/lifecycle-events.png" /></figure>
1010

1111
#### Lifecycle events
1212

content/guards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A guard is a class annotated with the `@Injectable()` decorator, which implements the `CanActivate` interface.
44

5-
<figure><img src="/assets/Guards_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Guards_1.png" /></figure>
66

77
Guards have a **single responsibility**. They determine whether a given request will be handled by the route handler or not, depending on certain conditions (like permissions, roles, ACLs, etc.) present at run-time. This is often referred to as **authorization**. Authorization (and its cousin, **authentication**, with which it usually collaborates) has typically been handled by [middleware](/middleware) in traditional Express applications. Middleware is a fine choice for authentication, since things like token validation and attaching properties to the `request` object are not strongly connected with a particular route context (and its metadata).
88

content/interceptors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
An interceptor is a class annotated with the `@Injectable()` decorator and implements the `NestInterceptor` interface.
44

5-
<figure><img src="/assets/Interceptors_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Interceptors_1.png" /></figure>
66

77
Interceptors have a set of useful capabilities which are inspired by the [Aspect Oriented Programming](https://en.wikipedia.org/wiki/Aspect-oriented_programming) (AOP) technique. They make it possible to:
88

content/microservices/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In addition to traditional (sometimes called monolithic) application architectur
44

55
In Nest, a microservice is fundamentally an application that uses a different **transport** layer than HTTP.
66

7-
<figure><img src="/assets/Microservices_1.png" /></figure>
7+
<figure><img class="illustrative-image" src="/assets/Microservices_1.png" /></figure>
88

99
Nest supports several built-in transport layer implementations, called **transporters**, which are responsible for transmitting messages between different microservice instances. Most transporters natively support both **request-response** and **event-based** message styles. Nest abstracts the implementation details of each transporter behind a canonical interface for both request-response and event-based messaging. This makes it easy to switch from one transport layer to another -- for example to leverage the specific reliability or performance features of a particular transport layer -- without impacting your application code.
1010

content/microservices/redis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The [Redis](https://redis.io/) transporter implements the publish/subscribe messaging paradigm and leverages the [Pub/Sub](https://redis.io/topics/pubsub) feature of Redis. Published messages are categorized in channels, without knowing what subscribers (if any) will eventually receive the message. Each microservice can subscribe to any number of channels. In addition, more than one channel can be subscribed to at a time. Messages exchanged through channels are **fire-and-forget**, which means that if a message is published and there are no subscribers interested in it, the message is removed and cannot be recovered. Thus, you don't have a guarantee that either messages or events will be handled by at least one service. A single message can be subscribed to (and received) by multiple subscribers.
44

5-
<figure><img src="/assets/Redis_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Redis_1.png" /></figure>
66

77
#### Installation
88

content/middlewares.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Middleware is a function which is called **before** the route handler. Middleware functions have access to the [request](https://expressjs.com/en/4x/api.html#req) and [response](https://expressjs.com/en/4x/api.html#res) objects, and the `next()` middleware function in the application’s request-response cycle. The **next** middleware function is commonly denoted by a variable named `next`.
44

5-
<figure><img src="/assets/Middlewares_1.png" /></figure>
5+
<figure><img class="illustrative-image" src="/assets/Middlewares_1.png" /></figure>
66

77
Nest middleware are, by default, equivalent to [express](https://expressjs.com/en/guide/using-middleware.html) middleware. The following description from the official express documentation describes the capabilities of middleware:
88

0 commit comments

Comments
 (0)