import { Controller , Get , UseGuards } from '@nestjs/common' ; import { AuthGuard } from '@nestjs/passport' ; import { AppService } from './app.service' ; @ Controller ( ) export class AppController { constructor ( private readonly appService ) { } @ Get ( ) getHello ( ) { return this . appService . getHello ( ) ; } @ UseGuards ( AuthGuard ( ) ) @ Get ( 'protected' ) getProtected ( ) { return 'This route is protected.' ; } }