mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
Health
This commit is contained in:
+1
-1
@@ -8,5 +8,5 @@ WORKDIR /app
|
||||
COPY . /app/
|
||||
COPY --from=packages /packages/node_modules /app/node_modules
|
||||
RUN npm run build
|
||||
EXPOSE 3000
|
||||
EXPOSE 3333
|
||||
ENTRYPOINT npm run start
|
||||
+2
-1
@@ -19,9 +19,10 @@ import { RestTransformationsController } from './rest/rest-transformations/rest-
|
||||
import { RestPipelinesController } from './rest/rest-pipelines/rest-pipelines.controller';
|
||||
import { RestEnrichmentsController } from './rest/rest-enrichments/rest-enrichments.controller';
|
||||
import { RestFactoryController } from './rest/rest-factory/rest-factory.controller';
|
||||
import { HealthModule } from './health/health.module';
|
||||
@Module({
|
||||
imports: [
|
||||
RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule,
|
||||
RestInputsModule, RestOutputsModule, RestEnrichmentsModule, RestTransformationsModule, RestPipelinesModule, RestUserModule, RestFactoryModule, HealthModule,
|
||||
// InputGrpcClientModule,
|
||||
//OutputsModule,
|
||||
//EnrichmentModule,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export class Health {}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { HealthService } from './health.service';
|
||||
|
||||
@Controller('health')
|
||||
export class HealthController {
|
||||
constructor(private readonly healthService: HealthService) {}
|
||||
|
||||
@Get()
|
||||
check() {
|
||||
return this.healthService.check();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HealthService } from './health.service';
|
||||
import { HealthController } from './health.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [HealthController],
|
||||
providers: [HealthService],
|
||||
})
|
||||
export class HealthModule {}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
export class HealthService {
|
||||
check() {
|
||||
return { message: 'Ok' };
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -1,24 +1,24 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
|
||||
import { writeFileSync } from 'fs';
|
||||
import { AppModule } from './app.module';
|
||||
require("dotenv").config();
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
import { config } from 'dotenv';
|
||||
config();
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Maestro Grpc Documentation')
|
||||
.setDescription('Documentation for Maestro gateway')
|
||||
.setVersion('1.0')
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
.setTitle('Maestro Grpc Documentation')
|
||||
.setDescription('Documentation for Maestro gateway')
|
||||
.setVersion('1.0')
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
writeFileSync('./swagger.json', JSON.stringify(document));
|
||||
SwaggerModule.setup('api', app, document);
|
||||
|
||||
|
||||
await (await app).listen(3000);
|
||||
await app.listen(3333);
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user