2023-02-06 12:50:07 +00:00
|
|
|
import { NestFactory } from '@nestjs/core';
|
|
|
|
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
|
|
|
|
import { join } from 'path';
|
|
|
|
import { AppModule } from './app.module';
|
|
|
|
|
|
|
|
async function bootstrap() {
|
|
|
|
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
|
|
|
|
AppModule,
|
|
|
|
{
|
|
|
|
transport: Transport.GRPC,
|
|
|
|
options: {
|
2023-03-31 08:29:25 +00:00
|
|
|
package: ['territory', 'health'],
|
|
|
|
protoPath: [
|
|
|
|
join(
|
|
|
|
__dirname,
|
|
|
|
'modules/territories/adapters/primaries/territory.proto',
|
|
|
|
),
|
|
|
|
join(__dirname, 'modules/health/adapters/primaries/health.proto'),
|
|
|
|
],
|
2023-02-06 12:50:07 +00:00
|
|
|
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
|
|
|
|
loader: { keepCase: true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
await app.listen();
|
|
|
|
}
|
|
|
|
bootstrap();
|