diff --git a/play/log.html b/play/log.html new file mode 100644 index 00000000..cbdb792b --- /dev/null +++ b/play/log.html @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/play/log.ru b/play/log.ru new file mode 100644 index 00000000..275e07c1 --- /dev/null +++ b/play/log.ru @@ -0,0 +1,18 @@ +require 'sinatra' + +set :server, :thin + +get '/' do + File.read('play/log.html') +end + +get '/log' do + chars = (97..122).to_a + stream do |out| + 1.upto(10000) do + out << chars[rand(chars.length)].chr + out << ' ' if rand(5) == 1 + sleep 0.001 + end + end +end