Sha256: eabae22a44a1d2b7ab781068a40c5d7c87763b30ed72c17cb4fabc5da6e5b57b
Contents?: true
Size: 425 Bytes
Versions: 7
Compression:
Stored size: 425 Bytes
Contents
class DemoServer def call(env) req = Rack::Request.new(env) Rack::Response.new.finish do |res| res['Content-Type'] = 'text/plain' if req.path.start_with? "/ok" res.status = 200 keys = [] req.params.each_key {|key| keys << key } str = keys.join(" ") puts keys res.write str else res.status = 404 res.write "ERROR" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems