12345678910111213141516171819 |
- import { Controller, Request, Post, UseGuards, Get } from '@nestjs/common';
- import { AuthGuard } from '@nestjs/passport';
- import { AuthService } from './auth/auth.service';
- @Controller()
- export class AppController {
- constructor(private readonly authService: AuthService) {}
- @UseGuards(AuthGuard('local'))
- @Post('login')
- async login(@Request() req) {
- return this.authService.login(req.user);
- }
- @Get('healthy')
- async checkServer() {
- return { status: 200 };
- }
- }
|