File tree Expand file tree Collapse file tree 2 files changed +12
-16
lines changed
Expand file tree Collapse file tree 2 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " nest-status-monitor" ,
3- "version" : " 0.0.1 " ,
3+ "version" : " 0.0.2 " ,
44 "description" : " Realtime Monitoring for Express-based Node applications" ,
55 "main" : " dist/index.js" ,
66 "repository" : {
Original file line number Diff line number Diff line change 1- import { Injectable } from '@nestjs/common' ;
1+ import { Injectable , Inject } from '@nestjs/common' ;
22import axios from 'axios' ;
3+ import { STATUS_MONITOR_OPTIONS_PROVIDER } from './status.monitor.constants' ;
4+ import { StatusMonitorConfiguration } from './config/status.monitor.configuration' ;
5+ import { HealthCheckConfiguration } from './config/health.check.configuration' ;
36
47@Injectable ( )
58export class HealthCheckService {
6- healthChecks = [
7- {
8- protocol : 'http' ,
9- host : 'localhost' ,
10- path : '/healt/alive' ,
11- port : '3001' ,
12- } ,
13- {
14- protocol : 'http' ,
15- host : 'localhost' ,
16- path : '/healt/dead' ,
17- port : '3001' ,
18- } ,
19- ] ;
9+ healthChecks : HealthCheckConfiguration [ ] = [ ] ;
10+
11+ constructor (
12+ @Inject ( STATUS_MONITOR_OPTIONS_PROVIDER ) config : StatusMonitorConfiguration ,
13+ ) {
14+ this . healthChecks = config . healthChecks ;
15+ }
2016
2117 checkAllEndpoints ( ) {
2218 const checkPromises = [ ] ;
You can’t perform that action at this time.
0 commit comments