您好,我在看您的第15天的練習,但是遇到些問題
我的專案是用cli建立的,版本是4.0.0-rc2,以下是main.ts
async function bootstrap() { const app = await NestFactory.create(ApplicationModule); app.connectMicroservice({ transport: Transport.TCP, strategy: new RabbitMQServer('XXX', 'example') }); console.log('start1'); await app.startAllMicroservicesAsync(); console.log('start2'); await app .listen(3001) .then(() => { console.log('MicroService is starting.'); }) .catch((error) => { console.error('Something wrong happened,', error); }); } bootstrap();
啟動Server後發現會卡在await app.startAllMicroservicesAsync();這步驟,console.log只會印出start1
不知道該如何解決呢??
您好,我在看您的第15天的練習,但是遇到些問題
我的專案是用cli建立的,版本是4.0.0-rc2,以下是main.ts
async function bootstrap() { const app = await NestFactory.create(ApplicationModule); app.connectMicroservice({ transport: Transport.TCP, strategy: new RabbitMQServer('XXX', 'example') }); console.log('start1'); await app.startAllMicroservicesAsync(); console.log('start2'); await app .listen(3001) .then(() => { console.log('MicroService is starting.'); }) .catch((error) => { console.error('Something wrong happened,', error); }); } bootstrap();啟動Server後發現會卡在await app.startAllMicroservicesAsync();這步驟,console.log只會印出start1
不知道該如何解決呢??