Class: CG::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/cg/server.rb

Instance Method Summary collapse

Constructor Details

#initializeServer

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