12345678910111213141516171819202122 |
- import { Inject, Injectable } from '@nestjs/common';
- import { ClientProxy } from '@nestjs/microservices';
- @Injectable()
- export class SampleAppService {
- constructor(@Inject(`FINGERPRINT_SERVICE`) private client: ClientProxy) {
- // logic here
- }
- getHello(): string {
- return 'Hello World! I am Sample App Nestjs.';
- }
- // testing. Try to talk to Fingerprint App via microservice
- talkToFingerprint(message: string): any {
- this.client.emit<string>(`eventTest`, message)
- return this.client.send<string>({ cmd: `messageTest` }, message)
- }
- }
|