Class: Anobik::App

Inherits:
Object
  • Object
show all
Defined in:
lib/anobik/app.rb

Class Method Summary collapse

Class Method Details

.create(debugger, production) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/anobik/app.rb', line 7

def self.create debugger, production
  Rack::Builder.new {
    use Rack::CommonLogger if debugger
    use Rack::ShowExceptions
    use Rack::ShowStatus
    use Rack::Static, :urls => ['/public']
    use Rack::Anobik, :url => '/',  :production => production

    #should never get through here if url is set to '/'
    run lambda { |env|
        [404, {'Content-Type' => 'text/plain'}, 'Not a Anobik Request :)']
     }
  }.to_app
end