Complete the code to import the core module in a NestJS application.
import { [1] } from '@nestjs/common';
The Module decorator is essential in NestJS to define application modules.
Complete the code to create a basic controller in NestJS.
@Controller('[1]') export class AppController {}
The controller path is usually named app for the main route.
Fix the error in the NestJS service provider declaration.
@Injectable() export class [1]Service {}
Service classes in NestJS are usually named with the suffix Service, like AppService.
Fill both blanks to define a NestJS module with a controller and a provider.
@Module({
controllers: [[1]],
providers: [[2]],
})
export class AppModule {}The module should list the AppController in controllers and AppService in providers.
Fill all three blanks to create a simple NestJS app bootstrap function.
async function bootstrap() {
const app = await NestFactory.[1](AppModule);
await app.[2](3000);
console.log('Application is running on port', [3]);
}The app is created with create, listens on port 3000, and logs the port number.
