Files
studimi_zheni/Nest/src/app.controller.ts
2022-09-22 10:08:42 +02:00

20 lines
487 B
TypeScript

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<string> {
const greeting = await this.appService.getHello();
return greeting;
}
@UseGuards(JwtAuthGuard)
@Get('/protected')
async getProtected() {
return 'PROTECTED';
}
}