diff --git a/first.ru b/first.ru new file mode 100644 index 00000000..0b749cc5 --- /dev/null +++ b/first.ru @@ -0,0 +1,7 @@ +require 'rack' + +my_server = Proc.new do + [200, {'Content-Type' => 'text/html'}, ['Hello']] +end + +run my_server \ No newline at end of file diff --git a/my_server.rb b/my_server.rb new file mode 100644 index 00000000..156aa7f7 --- /dev/null +++ b/my_server.rb @@ -0,0 +1,9 @@ +class MyServer + def call(env) + return [ 200, {'Content-Type' => 'text/html'}, pretty_response] + end + + def pretty_response + (Time.now.to_i % 2).zero? ? ["Hello"] : ["Hello"] + end +end \ No newline at end of file diff --git a/second.ru b/second.ru new file mode 100644 index 00000000..fd241a89 --- /dev/null +++ b/second.ru @@ -0,0 +1,13 @@ +require 'rack' + +class MyServer + def call(env) + return [200, {'Content-Type' => 'text/html'}, pretty_response] + end + + def pretty_response + (Time.now.to_i % 2).zero? ? ["Hello"] : ["Hello"] + end +end + +run MyServer.new \ No newline at end of file diff --git a/third.ru b/third.ru new file mode 100644 index 00000000..f227d2bd --- /dev/null +++ b/third.ru @@ -0,0 +1,2 @@ +require_relative './my_server' +run MyServer.new \ No newline at end of file