mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
21 lines
461 B
TypeScript
21 lines
461 B
TypeScript
import {
|
|
Controller,
|
|
Get,
|
|
Param,
|
|
UseGuards,
|
|
UseInterceptors,
|
|
} from '@nestjs/common';
|
|
import { Guard } from './guards/request-scoped.guard';
|
|
import { Interceptor } from './interceptors/logging.interceptor';
|
|
import { UserByIdPipe } from './users/user-by-id.pipe';
|
|
|
|
@Controller('test')
|
|
export class TestController {
|
|
@UseGuards(Guard)
|
|
@UseInterceptors(Interceptor)
|
|
@Get()
|
|
greeting(@Param('id', UserByIdPipe) id): string {
|
|
return 'hey';
|
|
}
|
|
}
|