Skip to main content

Controller

Nest Controller
import { Controller, Get, Post } from '@nestjs/common';

@Controller('cats')
export class CatsController {
@Post()
create(): string {
return 'This action adds a new cat';
}

@Get()
findAll(): string {
return 'This action returns all cats';
}

@Put(':id')
changeCat(@Param('id') id: string): string {
return `This action changes a #${id} cat`;
}
}