Class: Staticpress::Server

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

Instance Method Summary collapse

Constructor Details

#initializeServer

Returns a new instance of Server.



3
4
5
# File 'lib/staticpress/server.rb', line 3

def initialize
  @site = Staticpress::Site.new
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/staticpress/server.rb', line 7

def call(env)
  if content = @site.find_content_by_env(env)
    [ 200, { 'Content-Type' => content.content_type }, [ content.render ] ]
  else
    [ 404, {}, [] ]
  end
end