Sha256: 0a2ad45bd9f6587e51e2dbb2b54cb432594251d857ab7d1d9f0e0f41f46d077e
Contents?: true
Size: 538 Bytes
Versions: 4
Compression:
Stored size: 538 Bytes
Contents
require 'cuba' require 'json' Eye::Http::Router = Cuba.new do def json(result) res.headers['Content-Type'] = 'application/json; charset=utf-8' res.write({ result: result }.to_json) end on root do res.write Eye::ABOUT end on "api/info", param("filter") do |filter| json Eye::Control.command(:info_data, filter) end [:start, :stop, :restart, :delete, :unmonitor, :monitor].each do |act| on put, "api/#{act}", param("filter") do |filter| json Eye::Control.command(act, filter) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
reel-eye-0.5.2.1 | lib/eye/http/router.rb |
reel-eye-0.5.2 | lib/eye/http/router.rb |
reel-eye-0.5.1 | lib/eye/http/router.rb |
reel-eye-0.5 | lib/eye/http/router.rb |