src/core/nest-factory.ts
//nest工厂类
export class NestFactoryStatic {
//容器实例
private container = new NestContainer();
//实例加载器
private instanceLoader = new InstanceLoader(this.container);
//日志记录器
private logger = new Logger('NestFactory', true);
//依赖扫描器
private dependenciesScanner = new DependenciesScanner(
this.container, new MetadataScanner(),
);
//创建一个NestApplication实例,使用指定根模块类,与Express对象
public async create(module, express = ExpressAdapter.create()): Promise<INestApplication> {
//初始化根模块,进行模块依赖的提取、实例化
await this.initialize(module);
//创建应用程序类,返回一个代理对象,可以捕捉异常,打印异常
return this.createNestInstance<NestApplication>(
//一个应用程序类,使用容器、express创建
new NestApplication(this.container, express),
);
}
//创建一个NestMicroService实例,参数为模块与配置
public
最后
以上就是高兴缘分最近收集整理的关于nestjs核心之NestFactoryStatic类的全部内容,更多相关nestjs核心之NestFactoryStatic类内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复