Sha256: c3458f2e92eed8bc0316c641ef3aa41400193933d9ea386f11f902c33c6a7669

Contents?: true

Size: 417 Bytes

Versions: 6

Compression:

Stored size: 417 Bytes

Contents

#!/usr/bin/env ruby

require 'rack'
require 'redis'

# @author KILYA
# View profile by redis
#  port: 9292
#  url: 127.0.0.1
#  method GET
def my_method env
  redis = Redis.new host: "127.0.0.1", port: 6379, db: 15
  result = redis.get(:profile) || "Nothing to profile"
  [200, {}, [result]]
rescue StandardError
  [500, {}, ["Redis not available"]]
end

Rack::Handler::WEBrick.run method(:my_method), :Port => 9292

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smpl_prflr-0.0.8 bin/smpl_prflr
smpl_prflr-0.0.7 bin/smpl_prflr
smpl_prflr-0.0.6 bin/smpl_prflr
smpl_prflr-0.0.5 bin/smpl_prflr
smpl_prflr-0.0.4 bin/smpl_prflr
smpl_prflr-0.0.3 bin/smpl_prflr