Sha256: b1706cd898d080197a0ae021f3d4dbf3ed2a7dd957215bb89ca7aeb58203f90e
Contents?: true
Size: 398 Bytes
Versions: 27
Compression:
Stored size: 398 Bytes
Contents
class WatchCollector def call(env) post_data = begin Yajl::Parser.new(:symbolize_keys => true).parse(env["rack.input"].read) || {} rescue {} end post_data[:received_at] = Time.now.to_s Collector.process(post_data) [200,{"Content-Type" => "text/plain"},["Got it!"]] end Routes.add_route new, { :request_method => 'POST', :path_info => %r{^/receive} }, {}, :receive_data end
Version data entries
27 entries across 27 versions & 1 rubygems