import { Controller , Get , Post , Body } from '@nestjs/common' ; import { CatsService } from './cats.service' ; import { Cat } from './cat.model' ; @ Controller ( 'cats' ) export class CatsController { constructor ( private readonly catsService ) { } @ Get ( ) async getCats ( ) { return await this . catsService . findAll ( ) ; } @ Post ( ) async create ( @ Body ( ) cat ) { return await this . catsService . create ( cat ) ; } }