All quizzesEasy
NestJS Basics — Series 3
Preview — 3 of 10 questions
What makes AppModule special?
javascript
const app = await NestFactory.create(AppModule);AIts file name — Nest looks for app.module.ts by convention
BThe @Root() decorator it carries in addition to @Module()
CNothing about the class itself: it is the root purely because it is the module handed to NestFactory.create(), which then walks its imports to discover every other module
DIt is the only module allowed to declare controllers
Why is this the production start command rather than nest start?
javascript
nest build
node dist/main.jsAnest start cannot read environment variables
Bnest build compiles TypeScript to JavaScript in dist/, and production runs that output directly with Node — nest start is a development wrapper that compiles on the fly and depends on the Nest CLI being installed
Cnode dist/main.js enables clustering automatically, which nest start does not
DThey are identical; nest start is simply the longer form
What breaks if emitDecoratorMetadata is turned off?
javascript
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}ADependency injection by type stops working: the compiler no longer emits the constructor's parameter types, so Nest has no token to resolve and reports unresolvable dependencies
BDecorators themselves stop being recognised, so @Controller() becomes a syntax error
CNothing at runtime; the flag only affects editor tooling
DRoute paths are no longer registered, though providers still resolve
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.