mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
15 lines
287 B
Ruby
Executable File
15 lines
287 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
require 'webrick'
|
|
include WEBrick
|
|
|
|
config = {}
|
|
config.update(:Port => 8080)
|
|
config.update(:BindAddress => ARGV[0])
|
|
config.update(:DocumentRoot => ARGV[1])
|
|
server = HTTPServer.new(config)
|
|
['INT', 'TERM'].each {|signal|
|
|
trap(signal) {server.shutdown}
|
|
}
|
|
|
|
server.start
|