| 2 | |
| 3 | @Controller() |
| 4 | export class AppController { |
| 5 | @Get('hello/:name') |
| 6 | getHello(@Req() req): string { |
| 7 | return 'Hello: ' + req.extras?.data; |
| 8 | } |
| 9 | |
| 10 | @Get('params') |
| 11 | getParams(@Req() req): any { |
| 12 | return req.middlewareParams; |
| 13 | } |
| 14 | |
| 15 | @Get('health') |
| 16 | getHealth(): string { |
| 17 | return 'up'; |
| 18 | } |
| 19 | |
| 20 | @Get('test') |
| 21 | getTest(): string { |
| 22 | return 'test'; |
| 23 | } |
| 24 | |
| 25 | @Post('test') |
| 26 | postTest(): string { |
| 27 | return 'test'; |
| 28 | } |
| 29 | |
| 30 | @Get() |
| 31 | getHome(@Req() req) { |
| 32 | return 'Extras: ' + req.extras?.data + ', Count: ' + req.count; |
| 33 | } |
| 34 | |
| 35 | @Get('count') |
| 36 | getCount(@Req() req) { |
| 37 | return req.count; |
| 38 | } |
| 39 | } |