Class: Staticpress::Server
- Inherits:
-
Object
- Object
- Staticpress::Server
- Defined in:
- lib/staticpress/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.
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 |