Sha256: 1841f2a54ca1fa406a389a98ea0072869a2989aa821f1ace1c8884d827abb816

Contents?: true

Size: 362 Bytes

Versions: 5

Compression:

Stored size: 362 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
napa-0.5.0 lib/napa/middleware/app_monitor.rb
napa-0.4.3 lib/napa/middleware/app_monitor.rb
napa-0.4.1 lib/napa/middleware/app_monitor.rb
napa-0.4.0 lib/napa/middleware/app_monitor.rb
napa-0.3.0 lib/napa/middleware/app_monitor.rb