Sha256: 10c7f0eb69efe05e1478e30922d1081115227aaeb67940f7c3e5439b702a088d

Contents?: true

Size: 512 Bytes

Versions: 3

Compression:

Stored size: 512 Bytes

Contents

#!/usr/bin/env ruby
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'vifi'
require 'sinatra'

set :bind, '0.0.0.0'
set :port, 3141

get "/update_source", provides: 'text/event-stream' do
  stream(:keep_open) do |out|
    data = Hash.new
    loop do
      data[:label] = Time.now.strftime("%r")
      data[:value] = WillowRun::Status.new.getinfo.agrctlrssi
      out << "data: #{data.to_json}" + "\r\n\n"
      sleep 2
    end
  end
end

get "/" do
  Vifi.build_chart + Vifi.build_updater
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vifi-1.0.6 examples/app.rb
vifi-1.0.5 examples/app.rb
vifi-1.0.4 examples/app.rb