Complete the code to import the Controller decorator from NestJS.
import { [1] } from '@nestjs/common';
The Controller decorator is imported from '@nestjs/common' to define a controller in NestJS.
Complete the code to create a basic controller class named AppController.
export class [1]Controller {}
The main controller in a NestJS app is often named AppController.
Fix the error in the decorator to define a module with AppController.
@Module({
controllers: [[1]Controller],
})
export class AppModule {}The module should list the correct controller name, which is AppController.
Fill both blanks to create and start the NestJS application.
async function bootstrap() {
const app = await [1].create([2]Module);
await app.listen(3000);
}NestFactory creates the app instance and AppModule is the root module passed to it.
Fill in the blanks to define a simple GET route returning 'Hello World!'.
@Controller() export class AppController { @[1]() getHello(): string { return [2]; } }
The @Get() decorator defines a GET route. The method returns the string "Hello World!".
