| Class | Atchoum::Server |
| In: |
lib/atchoum/server.rb
|
| Parent: | Object |
# File lib/atchoum/server.rb, line 7
7: def initialize(script, port=2000)
8: @script = script
9: @port = port
10: end
Starts the webserver
# File lib/atchoum/server.rb, line 13
13: def start
14: puts "Starting server on http://localhost:#{@port}..."
15:
16: s = WEBrick::HTTPServer.new(
17: :Port => @port,
18: :DocumentRoot => Dir::pwd
19: )
20:
21: s.mount("/", Handler, @script)
22:
23: trap("INT") { s.shutdown }
24: s.start
25: end