Skip to content

Instantly share code, notes, and snippets.

@Vatsalya-singhi
Created March 27, 2025 18:47
Show Gist options
  • Save Vatsalya-singhi/451367be0433b26ff286cb4522fa7c52 to your computer and use it in GitHub Desktop.
Save Vatsalya-singhi/451367be0433b26ff286cb4522fa7c52 to your computer and use it in GitHub Desktop.
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