@@ -785,13 +785,13 @@ app.listen(3000);
785
785
786
786
## Using middlewares
787
787
788
- You can use any exist express / koa middleware, or create your own.
788
+ You can use any existing express / koa middleware, or create your own.
789
789
To create your middlewares there is a ` @Middleware ` decorator,
790
790
and to use already exist middlewares there are ` @UseBefore ` and ` @UseAfter ` decorators.
791
791
792
- ### Use exist middleware
792
+ ### Use existing middleware
793
793
794
- There are multiple ways to use middlewares .
794
+ There are multiple ways to use middleware .
795
795
For example, lets try to use [ compression] ( https://github.com/expressjs/compression ) middleware:
796
796
797
797
1 . Install compression middleware: ` npm install compression `
@@ -876,7 +876,7 @@ Here is example of creating middleware for express.js:
876
876
}
877
877
` ` `
878
878
879
- Then you can them this way :
879
+ Then you can use them this way :
880
880
881
881
` ` ` typescript
882
882
import {Controller, UseBefore} from "routing-controllers";
@@ -991,7 +991,7 @@ export class LoggingMiddleware implements ExpressMiddlewareInterface {
991
991
}
992
992
` ` `
993
993
994
- To enable this middleware specify it during routing - controllers initialization :
994
+ To enable this middleware , specify it during routing - controllers initialization :
995
995
996
996
` ` ` typescript
997
997
import "reflect-metadata";
@@ -1168,7 +1168,7 @@ export class UserController {
1168
1168
If ` User ` is an interface - then simple literal object will be created.
1169
1169
If its a class - then instance of this class will be created.
1170
1170
1171
- This technique works not only with ` @Body ` , but also with ` @Param ` , ` @QueryParam ` , ` @BodyParam ` and other decorators.
1171
+ This technique works with ` @Body ` , ` @Param ` , ` @QueryParam ` , ` @BodyParam ` , and other decorators.
1172
1172
Learn more about class-transformer and how to handle more complex object constructions [ here] [ 4 ] .
1173
1173
This behaviour is enabled by default.
1174
1174
If you want to disable it simply pass ` classTransformer: false ` to createExpressServer method.
0 commit comments