我正在尝试使用Nest 的文档设置一个简单的混合应用程序,但该应用程序卡住了而没有抛出。
main.ts
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
const logger = new Logger('Main');
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const configService = app.get(ConfigService);
const redisConfig = configService.get('database.redis');
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.REDIS,
options: {
url: `redis://${redisConfig.host}:${redisConfig.port}`,
},
});
await app.startAllMicroservices();
await app.listen(configService.get('app.port'));
}
bootstrap()
.then(() => logger.log('App running'))
.catch((e) => logger.error(e));
Run Code Online (Sandbox Code Playgroud)
当我注释掉 …
我做了一个自定义指令,我想在其中捕获鼠标中键单击事件。我认为这只是一个普通的点击事件,然后从那里开始,但只有在单击鼠标左键时才会触发。
@HostListener('click', ['$event']) onClick($event){
console.info('Click event fired', $event);
}
Run Code Online (Sandbox Code Playgroud)
有什么建议?
谢谢!