Commit 5956d847 authored by Fabien Forestier's avatar Fabien Forestier
Browse files

Merge branch 'development' into 'master'

Version 1.2.0

See merge request refonte-data/service-organizations!2
parents 5937393b f5800e71
Pipeline #2383 passed with stage
in 6 seconds
......@@ -27,8 +27,8 @@ build_release:
- build
only:
- tags
except:
- /^(?!master).+@/
# except:
# - /^(?!master).+@/
script:
- export TAG=$(echo $CI_COMMIT_TAG | sed 's/v//g')
- export POSTGRES_PORT=5432
......
This diff is collapsed.
{
"name": "service-organizations",
"version": "1.1.0",
"version": "1.2.0",
"description": "description",
"author": "",
"license": "MIT",
......@@ -24,9 +24,11 @@
"typeorm:migrate-ci": "ts-node -r tsconfig-paths/register ./node_modules/.bin/typeorm migration:run"
},
"dependencies": {
"@godaddy/terminus": "^4.1.0",
"@nestjs/common": "^5.1.0",
"@nestjs/core": "^5.1.0",
"@nestjs/swagger": "^2.5.1",
"@nestjs/terminus": "^5.5.0",
"@nestjs/typeorm": "^5.2.2",
"@types/dotenv": "^4.0.3",
"amqplib": "^0.5.2",
......
......@@ -2,8 +2,14 @@ import { Module } from '@nestjs/common';
import { OrganizationsModule } from './organizations/organizations.module';
import { TypeOrmModule } from '@nestjs/typeorm';
import { LinksModule } from './links/links.module';
import { HealthModule } from './health/health.module';
@Module({
imports: [TypeOrmModule.forRoot(), OrganizationsModule, LinksModule],
imports: [
TypeOrmModule.forRoot(),
OrganizationsModule,
LinksModule,
HealthModule,
],
})
export class AppModule { }
import {
TerminusEndpoint,
TerminusOptionsFactory,
TerminusModuleOptions,
DatabaseHealthIndicator,
} from '@nestjs/terminus';
import { Injectable } from '@nestjs/common';
@Injectable()
export class HealthCheckService implements TerminusOptionsFactory {
constructor(
private readonly _dbHealthIndicator: DatabaseHealthIndicator,
) { }
createTerminusOptions(): TerminusModuleOptions {
const healthEndpoint: TerminusEndpoint = {
url: '/health',
healthIndicators: [
async () => this._dbHealthIndicator.pingCheck('database', { timeout: 300 }),
],
};
return {
endpoints: [healthEndpoint],
};
}
}
\ No newline at end of file
import { Module } from '@nestjs/common';
import { TerminusModule } from '@nestjs/terminus';
import { HealthCheckService } from './health-check.service';
@Module({
imports: [
TerminusModule.forRootAsync({
useClass: HealthCheckService,
}),
],
})
export class HealthModule { }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment