class Notgun::Static
Serves static files out of the specified directory.
Public Class Methods
new(app, public_dir='./public')
click to toggle source
# File lib/notgun/static.rb, line 6 def initialize(app, public_dir='./public') @file = Rack::File.new(public_dir) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/notgun/static.rb, line 11 def call(env) status, headers, body = @file.call(env) if status > 400 @app.call(env) else [status, headers, body] end end