Sha256: b997e675027d22a85af73c7337beaca34e66329f0a7ce8a2dc5be9876d014245

Contents?: true

Size: 341 Bytes

Versions: 21

Compression:

Stored size: 341 Bytes

Contents

module Napa
  class Middleware
    class AppMonitor
      def initialize(app)
        @app = app
      end

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
napa-0.1.26 lib/napa/middleware/app_monitor.rb
napa-0.1.25 lib/napa/middleware/app_monitor.rb
napa-0.1.24 lib/napa/middleware/app_monitor.rb
napa-0.1.23 lib/napa/middleware/app_monitor.rb
napa-0.1.22 lib/napa/middleware/app_monitor.rb
napa-0.1.21 lib/napa/middleware/app_monitor.rb
napa-0.1.20 lib/napa/middleware/app_monitor.rb
napa-0.1.19 lib/napa/middleware/app_monitor.rb
napa-0.1.18 lib/napa/middleware/app_monitor.rb
napa-0.1.17 lib/napa/middleware/app_monitor.rb
napa-0.1.16 lib/napa/middleware/app_monitor.rb
napa-0.1.15 lib/napa/middleware/app_monitor.rb
napa-0.1.14 lib/napa/middleware/app_monitor.rb
napa-0.1.12 lib/napa/middleware/app_monitor.rb
napa-0.1.13 lib/napa/middleware/app_monitor.rb
napa-0.1.11 lib/napa/middleware/app_monitor.rb
napa-0.1.10 lib/napa/middleware/app_monitor.rb
napa-0.1.7 lib/napa/middleware/app_monitor.rb
napa-0.1.6 lib/napa/middleware/app_monitor.rb
napa-0.1.4 lib/napa/middleware/app_monitor.rb