bellycard/napa

View on GitHub
lib/napa/middleware/app_monitor.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Napa
  class Middleware
    class AppMonitor
      def initialize(app)
        @app = app
      end

      def call(env)
        if ['/health', '/health.json'].include? env['PATH_INFO']
          [200, { 'Content-type' => 'application/json' }, [Napa::Identity.health.to_json]]
        else
          @app.call(env)
        end
      end
    end
  end
end