matcher/src/main.ts

29 lines
963 B
TypeScript
Raw Normal View History

2023-04-06 09:12:49 +00:00
import { NestFactory } from '@nestjs/core';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
2023-04-06 12:21:43 +00:00
// import { join } from 'path';
2023-04-06 09:12:49 +00:00
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.TCP,
});
2023-04-06 12:21:43 +00:00
// app.connectMicroservice<MicroserviceOptions>({
// transport: Transport.GRPC,
// options: {
// // package: ['matcher', 'health'],
// package: ['health'],
// protoPath: [
// // join(__dirname, 'modules/matcher/adapters/primaries/matcher.proto'),
// join(__dirname, 'modules/health/adapters/primaries/health.proto'),
// ],
// url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
// loader: { keepCase: true },
// },
// });
2023-04-06 09:12:49 +00:00
await app.startAllMicroservices();
await app.listen(process.env.HEALTH_SERVICE_PORT);
}
bootstrap();