qiwi/qorsproxy

View on GitHub
src/main/js/servlet/health/index.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { StandardIndicator, Endpoint } from '@qiwi/health-indicator'

export default class Health {
  constructor (components) {
    this.indicator = new StandardIndicator()
    this.endpoint = new Endpoint(this.indicator)
    this.configure(components)
  }

  configure (components) {
    this.indicator.deps = components

    return this
  }

  handler (req, res) {
    this.endpoint.middleware(req, res)
  }
}