2022-12-15 09:59:45 +00:00
|
|
|
import { NestFactory } from '@nestjs/core';
|
2022-12-16 15:46:14 +00:00
|
|
|
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
|
|
|
|
import { join } from 'path';
|
2022-12-15 09:59:45 +00:00
|
|
|
import { AppModule } from './app.module';
|
|
|
|
|
|
|
|
async function bootstrap() {
|
2022-12-16 15:46:14 +00:00
|
|
|
const app = await NestFactory.createMicroservice<MicroserviceOptions>(
|
|
|
|
AppModule,
|
|
|
|
{
|
|
|
|
transport: Transport.GRPC,
|
|
|
|
options: {
|
2023-03-31 08:09:51 +00:00
|
|
|
package: ['authentication', 'authorization', 'health'],
|
2023-01-17 15:39:24 +00:00
|
|
|
protoPath: [
|
|
|
|
join(
|
|
|
|
__dirname,
|
|
|
|
'modules/authentication/adapters/primaries/authentication.proto',
|
|
|
|
),
|
|
|
|
join(
|
|
|
|
__dirname,
|
|
|
|
'modules/authorization/adapters/primaries/authorization.proto',
|
|
|
|
),
|
2023-03-31 08:09:51 +00:00
|
|
|
join(__dirname, 'modules/health/adapters/primaries/health.proto'),
|
2023-01-17 15:39:24 +00:00
|
|
|
],
|
2022-12-16 15:46:14 +00:00
|
|
|
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
|
2022-12-20 16:37:59 +00:00
|
|
|
loader: { keepCase: true, enums: String },
|
2022-12-16 15:46:14 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
await app.listen();
|
2022-12-15 09:59:45 +00:00
|
|
|
}
|
|
|
|
bootstrap();
|