Skip to content

Instantly share code, notes, and snippets.

@rskhan167
Created September 19, 2021 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rskhan167/b39459b364d89d2a7e0a90d15c98dc25 to your computer and use it in GitHub Desktop.
Save rskhan167/b39459b364d89d2a7e0a90d15c98dc25 to your computer and use it in GitHub Desktop.
import { Controller, Post, Body } from '@nestjs/common';
import { CreateUserDto } from './dtos/create-user.dto';
import { UserService } from './user.service';
import { User } from './entities/user.entity';
@Controller('user')
export class UserController {
constructor(private readonly userService: UserService) {}
@Post()
async create(@Body() createUserDto: CreateUserDto): Promise<User> {
return await this.userService.create(createUserDto);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment