File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -246,7 +246,8 @@ export class UserController {
246246
247247#### Using Request and Response objects
248248
249- You can use framework ' s request and response objects this way:
249+ You can use framework ' s request and response objects directly. If you want to handle the response by yourself,
250+ just make sure you return the response object itself from the action .
250251
251252` ` ` typescript
252253import {Controller, Req, Res, Get} from "routing-controllers";
@@ -256,7 +257,7 @@ export class UserController {
256257
257258 @Get("/users")
258259 getAll(@Req() request: any, @Res() response: any) {
259- response.send("Hello response!");
260+ return response.send("Hello response!");
260261 }
261262
262263}
@@ -274,7 +275,7 @@ export class UserController {
274275
275276 @Get("/users")
276277 getAll(@Req() request: Request, @Res() response: Response) {
277- response.send("Hello response!");
278+ return response.send("Hello response!");
278279 }
279280
280281}
You can’t perform that action at this time.
0 commit comments