Created
March 27, 2025 18:41
-
-
Save Vatsalya-singhi/6370074afad9847fb22b6068ad46642d 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, UseGuards } from '@nestjs/common'; | |
import { AuthGuard } from './auth.guard'; | |
@Controller('users') | |
export class UsersController { | |
@Get() | |
@UseGuards(AuthGuard) // Apply guard to this method | |
findAll() { | |
return { message: 'List of users' }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment