mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Display httpd URLs
This commit is contained in:
parent
d7da5ca5e1
commit
8361675e3a
Notes:
git
2021-08-23 09:59:43 +09:00
1 changed files with 8 additions and 0 deletions
|
@ -346,6 +346,14 @@ def httpd
|
|||
end
|
||||
options[:Port] ||= 8080 # HTTP Alternate
|
||||
options[:DocumentRoot] = argv.shift || '.'
|
||||
s = nil
|
||||
options[:StartCallback] = Proc.new do
|
||||
logger = s.logger
|
||||
logger.info("To access this server, open this file in a browser:")
|
||||
s.listeners.each do |listener|
|
||||
logger.info(" http://#{listener.connect_address.inspect_sockaddr}")
|
||||
end
|
||||
end
|
||||
s = WEBrick::HTTPServer.new(options)
|
||||
shut = proc {s.shutdown}
|
||||
siglist = %w"TERM QUIT"
|
||||
|
|
Loading…
Reference in a new issue