UNPKG

ticket-auth-project

Version:

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

28 lines (26 loc) 637 B
import { Body, Controller, Delete, Param, Post, UseGuards, } from '@nestjs/common'; import { UsersService } from './users.service'; import { JwtAuthGuard } from 'src/auth/jwt-auth.guard'; @Controller('users') export class UsersController { constructor(private readonly usersService: UsersService) {} @Post() async createUser( @Body('username') username: string, @Body('password') password: string, ) { return this.usersService.createUser(username, password); } @UseGuards(JwtAuthGuard) @Delete(':id') async deleteUser(@Param('id') id: string) { return this.usersService.deleteUser(id); } }