MCPcopy
hub / github.com/nestjs/nest / AppController

Class AppController

integration/nest-application/global-prefix/src/app.controller.ts:4–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3@Controller()
4export 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}

Callers

nothing calls this directly

Calls 1

PostClass · 0.50

Tested by

no test coverage detected