Class Atchoum::Server
In: lib/atchoum/server.rb
Parent: Object

Webserver the run the website in standalone local mode. Based on WEBrick.

Methods

new   start  

Public Class methods

[Source]

    # File lib/atchoum/server.rb, line 7
 7:     def initialize(script, port=2000)
 8:       @script = script
 9:       @port = port
10:     end

Public Instance methods

Starts the webserver

[Source]

    # 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

[Validate]