Skip to content

Instantly share code, notes, and snippets.

@Vatsalya-singhi
Created March 27, 2025 18:46
Show Gist options
  • Save Vatsalya-singhi/f42c91637b457c22ad140e76e36c58e3 to your computer and use it in GitHub Desktop.
Save Vatsalya-singhi/f42c91637b457c22ad140e76e36c58e3 to your computer and use it in GitHub Desktop.
import { Controller, Get, UseInterceptors } from '@nestjs/common';
import { LoggingInterceptor } from './logging.interceptor';
@Controller('users')
export class UsersController {
@Get()
@UseInterceptors(LoggingInterceptor) // Apply logging interceptor to this route
findAll() {
return { message: 'List of users' };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment