Skip to content

Commit 0faad16

Browse files
committed
Implement the second assignment in ruby
[refs #efdf2821ab7f]
1 parent d5c65b0 commit 0faad16

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

developing/examples/webapp/ruby/app.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@
44
set :port, 9494
55

66
get '/' do
7+
File.open('/tmp/requests.txt', 'a') do |file|
8+
file.puts "IP: #{request.ip}"
9+
file.puts "Hostname: #{Socket.gethostname}"
10+
file.puts "Path: #{request.path}"
11+
file.puts "Timestamp: #{Time.now}"
12+
file.puts '------------'
13+
end
714
'Hello World!'
815
end

developing/examples/webapp/ruby/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.3'
22

33
services:
44
app:
5-
image: jfahrer/webapp-ruby:v1
5+
image: jfahrer/webapp-ruby:v2
66
build:
77
context: .
88
volumes:

0 commit comments

Comments
 (0)