class ServerHere::Core

Public Instance Methods

call(env) click to toggle source
# File lib/server_here/core.rb, line 4
def call env
  req = Rack::Request.new env
  path = File.join('.', req.path_info)
  
  file = FileWrapper.new path
  
  header = {
    'Content-Type' => file.content_type,
    'Last-Modified' => file.last_mod
  }
  
  [200, header, file.to_body]
end