I just started working on Nestjs microservices Nest Version is 9.0 and the Node version is 16.0
I have created a service, and trying to make changes in code
App.module.ts
@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
App.controller.ts
@MessagePattern({ role: 'test', cmd: 'find_all' })
async findAll() {
logger.log('Hello, User!');
}
Expected Output
Hello, User
Actual Output
Hello World
After searching many things, I found that We have to execute the below command
npm run build
&
npm run start
This resolved my issue
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.