MCPcopy
hub / github.com/nestjs/nest / bootstrap

Function bootstrap

sample/18-context/src/main.ts:5–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { AppService } from './app.service';
4
5async function bootstrap() {
6 const app = await NestFactory.createApplicationContext(AppModule);
7
8 const appService = app.get(AppService);
9 console.log('AppService#getHello:', appService.getHello());
10
11 // Note that below we can't use `app.select(MyDynamicModule)` otherwise we would get an error as the static version of `MyDynamicModule` was not imported anywhere
12 const myDynamicProviderValue = app
13 .select(dynamicModule)
14 .get('MyDynamicProvider');
15 console.log('MyDynamicProvider:', myDynamicProviderValue);
16
17 return app.close();
18}
19bootstrap();

Callers 1

main.tsFile · 0.70

Calls 6

getMethod · 0.65
logMethod · 0.65
selectMethod · 0.65
closeMethod · 0.65
getHelloMethod · 0.45

Tested by

no test coverage detected