Skip to content

Instantly share code, notes, and snippets.

@jacobdo2
Created June 19, 2020 11:53
Show Gist options
  • Save jacobdo2/456bf45a8d11c822f84dbb69f2a62d25 to your computer and use it in GitHub Desktop.
Save jacobdo2/456bf45a8d11c822f84dbb69f2a62d25 to your computer and use it in GitHub Desktop.
import { Controller, Get, UseGuards } from '@nestjs/common';
import { AppService } from './app.service';
import { AuthGuard } from '@nestjs/passport';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
@UseGuards(AuthGuard('jwt'))
getHello(): string {
return this.appService.getHello();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment