0
0
NestJSframework~10 mins

Why NestJS exists - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the core module in a NestJS application.

NestJS
import { [1] } from '@nestjs/common';
Drag options to blanks, or click blank then click option'
AController
BModule
CService
DComponent
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Module with Controller or Service.
2fill in blank
medium

Complete the code to create a basic controller in NestJS.

NestJS
@Controller('[1]')
export class AppController {}
Drag options to blanks, or click blank then click option'
Aapp
Bhome
Croot
Dmain
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated route names like 'main' or 'root'.
3fill in blank
hard

Fix the error in the NestJS service provider declaration.

NestJS
@Injectable()
export class [1]Service {}
Drag options to blanks, or click blank then click option'
AAppService
BApp
CAppController
DApplication
Attempts:
3 left
💡 Hint
Common Mistakes
Using controller names or incomplete names without 'Service' suffix.
4fill in blank
hard

Fill both blanks to define a NestJS module with a controller and a provider.

NestJS
@Module({
  controllers: [[1]],
  providers: [[2]],
})
export class AppModule {}
Drag options to blanks, or click blank then click option'
AAppController
BAppService
CMainController
DMainService
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing controller and service names or using unrelated names.
5fill in blank
hard

Fill all three blanks to create a simple NestJS app bootstrap function.

NestJS
async function bootstrap() {
  const app = await NestFactory.[1](AppModule);
  await app.[2](3000);
  console.log('Application is running on port', [3]);
}
Drag options to blanks, or click blank then click option'
Acreate
Blisten
C3000
Dstart
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names like 'start' or missing the port number.