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