Complete the code to define a basic controller with the correct decorator.
import { [1] } from '@nestjs/common'; @[1]('cats') export class CatsController {}
The @Controller decorator defines a controller class in NestJS. It takes an optional route prefix like 'cats'.
Complete the code to create a controller with the route prefix 'dogs'.
import { Controller } from '@nestjs/common'; @Controller('[1]') export class DogsController {}
The string inside @Controller() sets the route prefix. Here, it should be 'dogs' to match the controller name.
Fix the error in the controller decorator import statement.
import { [1] } from '@nestjs/common'; @Controller('users') export class UsersController {}
The decorator must be imported with exact casing: Controller. JavaScript and TypeScript are case-sensitive.
Fill both blanks to create a controller with route prefix 'products' and export it.
[1] { Controller } from '@nestjs/common'; @[2]('products') export class ProductsController {}
You must import the Controller decorator and then use @Controller('products') to define the route prefix.
Fill all three blanks to define and export a controller with route prefix 'orders'.
[1] { [2] } from '@nestjs/common'; @[3]('orders') export class OrdersController {}
You import the Controller decorator, then use @Controller('orders') to set the route prefix.