diff --git a/src/app/homepage/pages/components/components.component.html b/src/app/homepage/pages/components/components.component.html index 88eb6d4a31..5939b6766d 100644 --- a/src/app/homepage/pages/components/components.component.html +++ b/src/app/homepage/pages/components/components.component.html @@ -55,7 +55,7 @@
The CatsService
is injected through the class constructor. Don't be afraid of the private readonly
shortened
- syntax. It means that we've created and initialized the catsService
member immedietely in the same
+ syntax. It means that we've created and initialized the catsService
member immediately in the same
location.
In some very specific cases, a property-based injection might be useful. For instance, if your top-level class
depends on either one or multiple providers, passing them all the way up by calling super()
- in sub-classes from the constructor can be very annonying. Thus, in order to avoid it, you can use @Inject()
+ in sub-classes from the constructor can be very annoying. Thus, in order to avoid it, you can use @Inject()
decorator on
a property level.
- Each ocurred exception is handled by the global exception filter, and when it's
+ Each occurred exception is handled by the global exception filter, and when it's
unrecognized (is neither
HttpException
nor a class that inherits from
HttpException
), a user receives the below JSON response:
diff --git a/src/app/homepage/pages/interceptors/interceptors.component.html b/src/app/homepage/pages/interceptors/interceptors.component.html
index 645a7bfc6f..8ecca74b7d 100644
--- a/src/app/homepage/pages/interceptors/interceptors.component.html
+++ b/src/app/homepage/pages/interceptors/interceptors.component.html
@@ -204,7 +204,7 @@
CacheInterceptor
with a hardcoded isCached
variable and the hardcoded response []
as
well. We returned a new stream here, created through the of
operator, therefore the route handler won't
be called at all. When someone calls endpoint that makes use of CacheInterceptor
, the response
- (a hardcoded, empty array) will be returned immedietely. In order to create a generic solution, you can take advantage
+ (a hardcoded, empty array) will be returned immediately. In order to create a generic solution, you can take advantage
of Reflector
and create a custom decorator. The Reflector
is well described in the guards
chapter.
@@ -222,4 +222,4 @@ After 5 seconds the request processing will be canceled.
- \ No newline at end of file + diff --git a/src/app/homepage/pages/microservices/basics/basics.component.html b/src/app/homepage/pages/microservices/basics/basics.component.html index b5d3492fa5..0ef5235b30 100644 --- a/src/app/homepage/pages/microservices/basics/basics.component.html +++ b/src/app/homepage/pages/microservices/basics/basics.component.html @@ -14,7 +14,7 @@In general, Nest supports a bunch of built-in transporters. They are based on request-response paradigm and a whole communication logic is hidden behind an abstraction layer. Thanks to that you can easily switch between transporters - without changing any line of your code. We don't support streaming platforms with log based persistance, such as Kafka or NATS streaming because they have been created to solve a different range of issues. However, you can still use them with Nest by making use of execution context feature. @@ -122,7 +122,7 @@
{{ clientProxy }}
The ClientProxy
is lazy. It doesn't initiate a connection immediately. Instead, it will
- be established before the first microservice's call, and then reused across each subsequent call. However, if you want
+ be established before the first microservice call, and then reused across each subsequent call. However, if you want
to delay an application's bootstrapping process and manually initialize a connection, you can use a connect()
method
inside the OnModuleInit
lifecycle hook.
@MessagePattern()
decorator, while payload
is a message
that we want to transmit to another microservice.
-
\ No newline at end of file
+
diff --git a/src/app/homepage/pages/middlewares/middlewares.component.html b/src/app/homepage/pages/middlewares/middlewares.component.html
index 6fa1311eb5..b6709d40d5 100644
--- a/src/app/homepage/pages/middlewares/middlewares.component.html
+++ b/src/app/homepage/pages/middlewares/middlewares.component.html
@@ -141,20 +141,19 @@
There are no contraindications that would prevent us from returning the async
function within the resolve()
method.
Also, it's possible to make the resolve()
method async
as well. This common pattern is called
- deffered middleware.
+ deferred middleware.
{{ defferedMiddleware }}
- {{ defferedMiddlewareJs }}
+ {{ deferredMiddleware }}
+ {{ deferredMiddlewareJs }}
The LoggerMiddleware
is quite short. It has no members, no additional methods, no dependencies. Why can't
- we just use a simple function? It's a good question, cause in fact - we can. This type of the middleware is called functional
- middleware
- . Let's transform the logger into a function.
+ we just use a simple function? It's a good question, cause in fact - we can. This type of the middleware is called
+ functional middleware. Let's transform the logger into a function.
We follow the Node.js release schedule which recently moved to 8.x
as an active LTS version.
Therefore, Nest 5 supports >= 8.9.0
as the lowest version now.
- This shift gaves us sustainable performance boosts thanks to the es2017
target of the TypeScript compilation.
+ This shift gave us sustainable performance boosts thanks to the es2017
target of the TypeScript compilation.
Nest 5 doesn't support rxjs < 6.0.0. Keep in mind to upgrade this package as well.
- \ No newline at end of file + diff --git a/src/app/homepage/pages/modules/modules.component.html b/src/app/homepage/pages/modules/modules.component.html index 095902d444..503dcf230b 100644 --- a/src/app/homepage/pages/modules/modules.component.html +++ b/src/app/homepage/pages/modules/modules.component.html @@ -109,9 +109,9 @@{{ reExportExamle }}
+ {{ reExportExample }}
A module class can inject providers as well (e.g. for configuration purposes): @@ -180,4 +180,4 @@
{{ singleScope }}
-->
-
\ No newline at end of file
+
diff --git a/src/app/homepage/pages/modules/modules.component.ts b/src/app/homepage/pages/modules/modules.component.ts
index c4ba691132..b20bc0fd8e 100644
--- a/src/app/homepage/pages/modules/modules.component.ts
+++ b/src/app/homepage/pages/modules/modules.component.ts
@@ -111,7 +111,7 @@ export class CatsModule {
}`;
}
- get reExportExamle() {
+ get reExportExample() {
return `
@Module({
imports: [CommonModule],
diff --git a/src/app/homepage/pages/pipes/pipes.component.html b/src/app/homepage/pages/pipes/pipes.component.html
index d8907df3b5..b924b0848e 100644
--- a/src/app/homepage/pages/pipes/pipes.component.html
+++ b/src/app/homepage/pages/pipes/pipes.component.html
@@ -210,7 +210,7 @@
The instance of
- ValidationPipe
has been created immedietely in-place. Another available way is to pass the class (not instance),
+ ValidationPipe
has been created immediately in-place. Another available way is to pass the class (not instance),
leaving framework the instantiation responsibility and enabling
dependency injection.
Notice You may find more information about the class-validator
package in its repository.
-
\ No newline at end of file
+
diff --git a/src/app/homepage/pages/recipes/prisma/prisma.component.html b/src/app/homepage/pages/recipes/prisma/prisma.component.html
index ca90c8afb5..7b9f364732 100644
--- a/src/app/homepage/pages/recipes/prisma/prisma.component.html
+++ b/src/app/homepage/pages/recipes/prisma/prisma.component.html
@@ -67,7 +67,7 @@ {{ prismaService }}
- Once PrismaService
is ready, we need to create a correspoding module.
+ Once PrismaService
is ready, we need to create a corresponding module.
{{ prismaModule }}
@@ -94,4 +94,4 @@
- But firstly, we need at least one entity. We are going to reuse the Photo
entity from the offical documentation.
+ But firstly, we need at least one entity. We are going to reuse the Photo
entity from the official documentation.
{{ photoEntity }}
@@ -68,4 +68,4 @@ Hint Don't forget to import the- \ No newline at end of file + diff --git a/src/app/homepage/pages/recipes/swagger/swagger.component.html b/src/app/homepage/pages/recipes/swagger/swagger.component.html index 5ac195ddf3..ad5bcf29b3 100644 --- a/src/app/homepage/pages/recipes/swagger/swagger.component.html +++ b/src/app/homepage/pages/recipes/swagger/swagger.component.html @@ -47,6 +47,11 @@PhotoModule
into the rootApplicationModule
.
SwaggerModule
automatically reflects all of your endpoints.
In the background, it's making use of swagger-ui-express
and creates a live documentation.
+ + Hint If you want to download the corresponding `Swagger JSON` file, you can simply call +http://localhost:3000/api-json
in your browser (if your Swagger documentation is published under +http://localhost:3000/api
). +
During the examination of the defined controllers, the SwaggerModule
is looking for all used @Body()
,
@@ -122,7 +127,7 @@
setup()
before you can start working on a second SwaggerOptions for a second Swagger Specification. This
specific order is to
- prevent Swagger configurations being overriden by different options.
+ prevent Swagger configurations being overridden by different options.
diff --git a/src/app/homepage/pages/techniques/caching/caching.component.html b/src/app/homepage/pages/techniques/caching/caching.component.html index bd7c99916d..6d8006e36c 100644 --- a/src/app/homepage/pages/techniques/caching/caching.component.html +++ b/src/app/homepage/pages/techniques/caching/caching.component.html @@ -11,8 +11,8 @@
$ npm install --save cache-manager
- Nest provides a unified API for various cache storages. The built-in one is an in-memory data store. However, you can easily
- switch to a more comprehensive solution, like Redis. In order to enable caching, firstly import CacheModule
and
+ Nest provides a unified API for various cache storage providers. The built-in one is an in-memory data store. However, you can easily
+ switch to a more comprehensive solution, like Redis. In order to enable caching, firstly import CacheModule
and
call its register()
method.
{{ inMemoryCache }}
@@ -55,7 +55,7 @@ register()
method.
{{ redisStore }}
diff --git a/src/app/homepage/pages/techniques/compression/compression.component.html b/src/app/homepage/pages/techniques/compression/compression.component.html
index 193d63d1be..70df5c1332 100644
--- a/src/app/homepage/pages/techniques/compression/compression.component.html
+++ b/src/app/homepage/pages/techniques/compression/compression.component.html
@@ -17,7 +17,7 @@ Hint - If you work wtihFastifyAdapter
, consider using fastify-compress + If you work withFastifyAdapter
, consider using fastify-compress instead.
diff --git a/src/app/homepage/pages/techniques/configuration/configuration.component.html b/src/app/homepage/pages/techniques/configuration/configuration.component.html index a2e9bda159..d9b46eb172 100644 --- a/src/app/homepage/pages/techniques/configuration/configuration.component.html +++ b/src/app/homepage/pages/techniques/configuration/configuration.component.html @@ -63,7 +63,7 @@
{{ configServiceInjection }}
- Instead of importingConfigModule
repeatingly in all your modules, you can also declareConfigModule
as + Instead of importingConfigModule
in all your modules, you can also declareConfigModule
as a global module.
.env
file
'true'
), and thus have to cast them to a boolean
every
+ the env file provides booleans as string ('true'
), and thus have to cast them to a boolean
every
time
{{ advancedConfigServiceSample }}
-
\ No newline at end of file
+
diff --git a/src/app/homepage/pages/techniques/file-upload/file-upload.component.html b/src/app/homepage/pages/techniques/file-upload/file-upload.component.html
index b998eafd63..4ca6b4b162 100644
--- a/src/app/homepage/pages/techniques/file-upload/file-upload.component.html
+++ b/src/app/homepage/pages/techniques/file-upload/file-upload.component.html
@@ -39,10 +39,10 @@ @UploadedFiles()
decorator
- {{ multipleFiles }}
- {{ multipleFilesJs }}
+ {{ multipleFiles }}
+ {{ multipleFilesJs }}
Hint BothFilesInterceptor()
and@UploadedFiles()
decorator are exposed from@nestjs/common
package. @@ -94,4 +94,4 @@Async configuration
It works the same asuseClass
with one critical difference -MulterModule
will lookup imported modules to reuse already createdConfigService
, instead of instantiating it on its own. - \ No newline at end of file + diff --git a/src/app/homepage/pages/techniques/logger/logger.component.html b/src/app/homepage/pages/techniques/logger/logger.component.html index 95c6fe4d85..132e1259ec 100644 --- a/src/app/homepage/pages/techniques/logger/logger.component.html +++ b/src/app/homepage/pages/techniques/logger/logger.component.html @@ -36,7 +36,7 @@Dependency injection
{{ loggerModule }}
Once
LoggerModule
is imported anywhere, the framework will take charge of creating an instance of your logger. - Now, to use the same instance of a logger across the whole app, including bootstraping and error handling stuff, use + Now, to use the same instance of a logger across the whole app, including bootstrapping and error handling stuff, use following construction:@@ -44,4 +44,4 @@{{ useLoggerDi }}
Dependency injection
The only downside of this solution is that your first initialization messages won't be handled by your logger instance, though, it shouldn't really matter at this point. - \ No newline at end of file + diff --git a/src/app/homepage/pages/techniques/security/security.component.html b/src/app/homepage/pages/techniques/security/security.component.html index eca172e390..5ad4ad1280 100644 --- a/src/app/homepage/pages/techniques/security/security.component.html +++ b/src/app/homepage/pages/techniques/security/security.component.html @@ -66,7 +66,7 @@Rate limiting
{{ expressRateLimit }}Hint - If you work wtih- \ No newline at end of file + diff --git a/src/app/homepage/pages/techniques/serialization/serialization.component.html b/src/app/homepage/pages/techniques/serialization/serialization.component.html index 35c594ac41..69cfc038cc 100644 --- a/src/app/homepage/pages/techniques/serialization/serialization.component.html +++ b/src/app/homepage/pages/techniques/serialization/serialization.component.html @@ -5,7 +5,7 @@FastifyAdapter
, consider using FastifyAdapter, consider using fastify-rate-limit instead.Serialization
For instance, sensitive data like user's password should be always excluded from the eventual response. Furthermore, certain properties might require additional transformation, let's say, we don't want to send the whole database entity. Instead, we would like to pick onlyid
andname
. The rest should be automatically stripped. - Unluckily, manually mapping all entities may bring a lot of confusedness. + Unluckily, manually mapping all entities may bring a lot of confusion.Overview
@@ -53,15 +53,15 @@
Pass options
The@SerializeOptions()
decorator is imported from@nestjs/common
package.
- These opions will be passed as a second argument of the classToPlain()
function.
+ These options will be passed as a second argument of the classToPlain()
function.
- All these guidelines cornern both WebSockets as well as microservices, regardless of transport method that is being used. + All these guidelines concern both WebSockets as well as microservices, regardless of transport method that is being used.
In order to read more about available decorators, options, visit this page.
- \ No newline at end of file + diff --git a/src/app/homepage/pages/techniques/sql/sql.component.html b/src/app/homepage/pages/techniques/sql/sql.component.html index 0700e91083..92e098b6b9 100644 --- a/src/app/homepage/pages/techniques/sql/sql.component.html +++ b/src/app/homepage/pages/techniques/sql/sql.component.html @@ -54,7 +54,7 @@
- Firstly, we need at least one entity. We're gonna reuse the Photo
entity from the offical documentation.
+ Firstly, we need at least one entity. We're gonna reuse the Photo
entity from the official documentation.
A working example is available here.
- \ No newline at end of file + diff --git a/src/app/homepage/pages/websockets/adapter/adapter.component.html b/src/app/homepage/pages/websockets/adapter/adapter.component.html index fe7421ae28..077caf743e 100644 --- a/src/app/homepage/pages/websockets/adapter/adapter.component.html +++ b/src/app/homepage/pages/websockets/adapter/adapter.component.html @@ -49,7 +49,7 @@WsAdapter
which in turn acts like a proxy between the framework and integrate
blazing fast and thoroughly tested ws library. This adapter
is fully compatible with native browser WebSockets and is far faster than socket.io package. Unluckily, it has significantly
- fewer functionalities available out-of-the-box. In some cases, you may just don't necesserily need them though.
+ fewer functionalities available out-of-the-box. In some cases, you may just don't necessarily need them though.
{{ setupAdapter }}
@@ -59,7 +59,7 @@Advanced (custom adapter)
For demonstration purposes, we are going to handwritten integrate the ws library. As mentioned, the adapter for this library is already created and is exposed from the
{{ 'ws-adapter' | extension: wsAdapterT.isJsActive }} @@ -83,4 +83,4 @@@nestjs/websockets
package - as aWsAdapter
class. Here is how the simplified implementation could potentialy looks like: + as aWsAdapter
class. Here is how the simplified implementation could potentially looks like:Example
A working example that uses
- \ No newline at end of file +WsAdapter
is available here.