diff --git a/webrick.rb b/webrick.rb index 735ee5e..b2d51cc 100644 --- a/webrick.rb +++ b/webrick.rb @@ -11,4 +11,14 @@ server.shutdown } +server.mount_proc("/time") do |req, res| + # レスポンス内容を出力 + body = "\n" + body += "#{Time.new}" + body += "\n" + res.status = 200 + res['Content-Type'] = 'text/html' + res.body = body +end + server.start