Updated

lib / health_check_middleware.rb

A
21 lines of codes
2 methods
3.2 complexity/method
1 churn
6.42 complexity
0 duplications
require 'health_check' class HealthCheckMiddleware
  1. HealthCheckMiddleware has no descriptive comment
def initialize(app) @app = app end def call(env) if env['PATH_INFO'] =~ %r[\A/health-check/?\Z] [ 200, { 'Content-Type' => 'application/json', }, [HealthCheck.checkup(env).to_json] ] else @app.call(env) end end end