class Gris::Middleware::Health

Public Class Methods

new(app) click to toggle source
# File lib/gris/middleware/health.rb, line 4
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/gris/middleware/health.rb, line 8
def call(env)
  if ['/health', '/health.json'].include? env['PATH_INFO']
    [200, { 'Content-type' => 'application/json' }, [Gris::Identity.health.to_json]]
  else
    @app.call(env)
  end
end