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 {
246
246
247
247
#### Using Request and Response objects
248
248
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 .
250
251
251
252
` ` ` typescript
252
253
import {Controller, Req, Res, Get} from "routing-controllers";
@@ -256,7 +257,7 @@ export class UserController {
256
257
257
258
@Get("/users")
258
259
getAll(@Req() request: any, @Res() response: any) {
259
- response.send("Hello response!");
260
+ return response.send("Hello response!");
260
261
}
261
262
262
263
}
@@ -274,7 +275,7 @@ export class UserController {
274
275
275
276
@Get("/users")
276
277
getAll(@Req() request: Request, @Res() response: Response) {
277
- response.send("Hello response!");
278
+ return response.send("Hello response!");
278
279
}
279
280
280
281
}
You can’t perform that action at this time.
0 commit comments