Sha256: 3206efd18675cbe92f92b0f761190eb49e38e300446faab0b1af9c51b73894ea
Contents?: true
Size: 435 Bytes
Versions: 12
Compression:
Stored size: 435 Bytes
Contents
require 'rack' require 'json' app = Proc.new do |env| request_json = { verb: env["REQUEST_METHOD"], uri: env["REQUEST_URI"], body: env["rack.input"].read, protcol: env["SERVER_PROTOCOL"], headers: Hash[env.select {|k, v| k.start_with?("HTTP_") }.map {|k, v| [k[5..-1], v] }] }.to_json [200, {'Content-Type' => "application/json", 'Content-Length' => request_json.length.to_s}, [request_json]] end run app
Version data entries
12 entries across 12 versions & 1 rubygems