Sha256: f6b477394bac7b616814c5a031f71bf93e777a0d8a139086f9a868df7ea309a1

Contents?: true

Size: 429 Bytes

Versions: 3

Compression:

Stored size: 429 Bytes

Contents

#!/usr/bin/env ruby

require "webrick"

puts "ARGV: #{ARGV.inspect}"

port = ARGV.grep(/localhost:/).first.split(':', 2).last rescue 1234
puts "listening on port: #{port}"

server = WEBrick::HTTPServer.new(:Port => port)

server.mount_proc '/health_check' do |req, res|
	puts 'got health_check request'
	res.body = "OK\n\r"
end

trap("INT") {
	server.shutdown
}

trap("TERM") {
	server.shutdown
}

puts "starting"

server.start

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-background-process-0.1.2 spec/support/test_http_server
rspec-background-process-0.1.1 spec/support/test_http_server
rspec-background-process-0.1.0 spec/support/test_http_server