Skip to content

chore: add another example for using the response directly #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,19 @@ import {Controller, Req, Res, Get} from "routing-controllers";
export class UserController {

@Get("/users")
getAll(@Req() request: any, @Res() response: any) {
getAllUsers(@Req() request: any, @Res() response: any) {
return response.send("Hello response!");
}

@Get("/posts")
getAllPosts(@Req() request: any, @Res() response: any) {
// some response functions don't return the response object,
// so it needs to be returned explicitly
response.redirect("/users");

return response;
}

}
```

Expand Down