Create Controller
- To create a controller using the CLI, simply execute the
nest g controller [name]
import { Controller, Get } from '@nestjs/common';
@Controller('tasks')
export class TaskController {
@Get()
findAll(): string {
return 'This action returns all tasks';
}
@Post()
create(): string {
return 'This action adds a new task';
}
}
- API URL - http://localhost:8080/tasks