Skip to content
Snippets Groups Projects
Verified Commit c243ab63 authored by Konstantin Tsabolov's avatar Konstantin Tsabolov
Browse files

chore: refactor ssi to support health endpoint

parent 701da8df
No related branches found
No related tags found
1 merge request!30Helm charts
import type { MicroserviceOptions, NatsOptions } from '@nestjs/microservices'; import type { MicroserviceOptions, NatsOptions } from '@nestjs/microservices';
import { Logger } from '@nestjs/common';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { Transport } from '@nestjs/microservices'; import { Transport } from '@nestjs/microservices';
import { AppModule } from './app.module.js'; import { AppModule } from './app.module.js';
import { config } from './config/config.js'; import { config } from './config/config.js';
const app = await NestFactory.create(AppModule);
const { url, user, password } = config().nats; const { url, user, password } = config().nats;
const options: Required<NatsOptions> = { const options: Required<NatsOptions> = {
transport: Transport.NATS, transport: Transport.NATS,
...@@ -21,9 +24,9 @@ if (user && password) { ...@@ -21,9 +24,9 @@ if (user && password) {
options.options.pass = password; options.options.pass = password;
} }
const app = await NestFactory.createMicroservice<MicroserviceOptions>( app.connectMicroservice<MicroserviceOptions>(options);
AppModule,
options, const port = config().port;
); await app.listen(port as number);
await app.listen(); Logger.log(`Application is running on: ${await app.getUrl()}`);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment