Commit 63492726 authored by Alessio Caiazza's avatar Alessio Caiazza

Improve code quality

parent 3fc05cdf
Pipeline #1415 passed with stages
in 67 minutes and 46 seconds
......@@ -4,13 +4,14 @@ require 'securerandom'
server = WEBrick::HTTPServer.new :Port => ENV.fetch('PORT'){ 5000 }
#Return a successful Hello World response.
server.mount_proc '/' do |request, response|
server.mount_proc '/' do |_request, response|
#TODO: use HTML
response.body = 'Hello, world!'
sleep 0.125 + SecureRandom.random_number*0.250
end
#Return an error to help demonstrate monitoring capabilities
server.mount_proc '/error' do |request, response|
server.mount_proc '/error' do |_request, response|
response.status = 500
response.body = 'Sorry we encountered an error.'
sleep 1.0+SecureRandom.random_number
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment