|
Revision 1843, 376 bytes
(checked in by nahi, 2 years ago)
|
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
#!/usr/bin/env ruby |
|---|
| 2 |
|
|---|
| 3 |
require 'webrick' |
|---|
| 4 |
require 'soap/property' |
|---|
| 5 |
|
|---|
| 6 |
docroot = "." |
|---|
| 7 |
port = 8808 |
|---|
| 8 |
if opt = SOAP::Property.loadproperty("samplehttpd.conf") |
|---|
| 9 |
docroot = opt["docroot"] |
|---|
| 10 |
port = Integer(opt["port"]) |
|---|
| 11 |
end |
|---|
| 12 |
|
|---|
| 13 |
s = WEBrick::HTTPServer.new( |
|---|
| 14 |
:BindAddress => "0.0.0.0", |
|---|
| 15 |
:Port => port, |
|---|
| 16 |
:DocumentRoot => docroot, |
|---|
| 17 |
:CGIPathEnv => ENV['PATH'] |
|---|
| 18 |
) |
|---|
| 19 |
trap(:INT){ s.shutdown } |
|---|
| 20 |
s.start |
|---|