auth/src/main.ts

25 lines
664 B
TypeScript
Raw Normal View History

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: {
package: 'auth',
protoPath: join(
__dirname,
'modules/auth/adapters/primaries/auth.proto',
),
url: process.env.SERVICE_URL + ':' + process.env.SERVICE_PORT,
loader: { keepCase: true },
},
},
);
await app.listen();
2022-12-15 09:59:45 +00:00
}
bootstrap();