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

Version Path
dock_test-0.2.1 config.ru
dock_test-0.2.0 config.ru
dock_test-0.1.7 config.ru
dock_test-0.1.6 config.ru
dock_test-0.1.5 config.ru
dock_test-0.1.3 config.ru
dock_test-0.1.2 config.ru
dock_test-0.1.1 config.ru
dock_test-0.1.0 config.ru
dock_test-0.0.3 config.ru
dock_test-0.0.2 config.ru
dock_test-0.0.1 config.ru