15 lines
406 B
TypeScript
15 lines
406 B
TypeScript
|
|
|
||
|
|
import { Body, Controller, Post, HttpCode, HttpStatus } from '@nestjs/common';
|
||
|
|
import { AuthService } from './auth.service';
|
||
|
|
|
||
|
|
@Controller('auth')
|
||
|
|
export class AuthController {
|
||
|
|
constructor(private authService: AuthService) {}
|
||
|
|
|
||
|
|
@HttpCode(HttpStatus.OK)
|
||
|
|
@Post('login')
|
||
|
|
signIn(@Body() signInDto: Record<string, any>) {
|
||
|
|
return this.authService.signIn(signInDto.username, signInDto.password);
|
||
|
|
}
|
||
|
|
}
|