/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
sample/18-context/src/main.ts
19 строк
709 B
haouvw
chore: fix some comments
27 авг 2024, 14:08
27 авг 2024, 14:08
8b4af57
Код
Авторство
О чём код?
import { NestFactory } from '@nestjs/core'; import { AppModule, dynamicModule } from './app.module'; import { AppService } from './app.service'; async function bootstrap() { const app = await NestFactory.createApplicationContext(AppModule); const appService = app.get(AppService); console.log('AppService#getHello:', appService.getHello()); // 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 const myDynamicProviderValue = app .select(dynamicModule) .get('MyDynamicProvider'); console.log('MyDynamicProvider:', myDynamicProviderValue); return app.close(); } bootstrap();