Class: Wouter

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

Defined Under Namespace

Classes: Endpoint, Request, Response, Wrapper

Class Method Summary collapse

Class Method Details

.appObject

Internal


56
57
58
# File 'lib/wouter.rb', line 56

def self.app
  @app ||= Rack::Builder.new
end

.buildObject

Build a Rack entry point


84
85
86
87
# File 'lib/wouter.rb', line 84

def self.build
  app.run(Wrapper.new(routes))
  app.to_app
end

.middleware(klass, *args, &block) ⇒ Object



77
78
79
# File 'lib/wouter.rb', line 77

def middleware(klass, *args, &block)
  app.use(klass, *args, &block)
end

.routesObject



60
61
62
# File 'lib/wouter.rb', line 60

def self.routes
  @routes ||= []
end