Created
March 27, 2025 18:47
-
-
Save Vatsalya-singhi/451367be0433b26ff286cb4522fa7c52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Get, UseInterceptors } from '@nestjs/common'; | |
import { LoggingInterceptor } from './logging.interceptor'; | |
@Controller('users') | |
@UseInterceptors(LoggingInterceptor) // Apply to all routes in this controller | |
export class UsersController { | |
@Get() | |
findAll() { | |
return { message: 'List of users' }; | |
} | |
@Get(':id') | |
findOne() { | |
return { message: 'User details' }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment