Class: Rubrowser::Server
- Inherits:
-
WEBrick::HTTPServer
- Object
- WEBrick::HTTPServer
- Rubrowser::Server
- Includes:
- ERB::Util
- Defined in:
- lib/server.rb
Constant Summary collapse
- ROUTES =
{ '/' => :root, '/data.json' => :data }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(options) ⇒ Server
Returns a new instance of Server.
19 20 21 22 23 24 25 26 |
# File 'lib/server.rb', line 19 def initialize() super Port: [:port] @files = [:files] mount_proc '/' do |req, res| res.body = router(req.path) end end |
Class Method Details
.start(options = {}) ⇒ Object
15 16 17 |
# File 'lib/server.rb', line 15 def self.start( = {}) new().start end |