Sha256: eca2ef02d04c6df145b869acc84518994d90925fe4b36f95bde4154e543f42a8

Contents?: true

Size: 569 Bytes

Versions: 12

Compression:

Stored size: 569 Bytes

Contents

#!/bin/sh

ruby_script=$(cat << EOM
require 'rack/utils'
require 'rack'

STDOUT.sync = true
puts "Starting webhook server which will return random errors"

app = -> (env) {
  status = [200, 500, 500, 500].sample
  puts Rack::Utils.parse_nested_query(env['QUERY_STRING']) if env['QUERY_STRING'] && env['QUERY_STRING'] != ''
  puts env['rack.input'].read
  [status, {"Content-Type" => "text/plain"}, ["Webhook response.\n"]].tap { |it| puts it }
}

Rack::Server.start(
 :app => app,
 :server => 'webrick',
 :Port => 9393
)
EOM
)

echo "${ruby_script}" | bundle exec ruby

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.89.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.88.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.87.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.86.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.85.1 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.85.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.84.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.83.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.82.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.81.0 script/dev/webhook-server-with-random-errors.sh
pact_broker-2.80.0 script/dev/webhook-server-with-random-errors.sh