import { Controller , Get , Res , HttpStatus , UseGuards } from '@nestjs/common' ; import { AppService } from './app.service' ; import { Response } from 'express' ; import { AuthGuard } from '@nestjs/passport' ; @ Controller ( ) export class AppController { constructor ( private readonly appService ) { } @ Get ( ) getHello ( @ Res ( ) res ) { return res . status ( HttpStatus . OK ) . json ( this . appService . getHello ( ) ) ; } @ UseGuards ( AuthGuard ( 'jwt' ) ) @ Get ( 'secure' ) getProtectedResource ( @ Res ( ) res ) { return res . status ( HttpStatus . OK ) . json ( this . appService . getSecureResource ( ) ) ; } }