class Vienna::Application

`Vienna::Application` serves all files under the given root directory using `Vienna::Static`. If a file/path doen't exist, `Vienna::NotFound` is run, which always returns a status of `404` and the contents of `404.html` or `'Not Found'` if one does not exist.

Examples

run Vienna::Application.new('_site')

run Vienna::Application.new # The root defaults to 'public'

Public Class Methods

new(root = 'public') click to toggle source
# File lib/vienna.rb, line 126
def initialize(root = 'public')
  @app = Rack::Builder.new do
    use Static, root
    run NotFound.new("#{root}/404.html")
  end
end

Public Instance Methods

call(env) click to toggle source
# File lib/vienna.rb, line 133
def call(env)
  @app.call(env)
end