Class: CG::Server
- Inherits:
-
Object
- Object
- CG::Server
- Defined in:
- lib/cg/server.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize ⇒ Server
Returns a new instance of Server.
8 9 10 |
# File 'lib/cg/server.rb', line 8 def initialize @file_server = Rack::File.new('.') end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/cg/server.rb', line 12 def call(env) env['PATH_INFO'] = '/index.html' if env['PATH_INFO'] == '/' puts env['PATH_INFO'] @file_server.call(env) end |