import { Controller, Get, UseGuards } from '@nestjs/common'; import { AppService } from './app.service'; import { JwtAuthGuard } from './auth/jwt.guard'; @Controller() export class AppController { constructor(private readonly appService: AppService) {} @Get() async getHello(): Promise { const greeting = await this.appService.getHello(); return greeting; } @UseGuards(JwtAuthGuard) @Get('/protected') async getProtected() { return 'PROTECTED'; } }